awful.util.deprecate: do not use glib.String() for the hash
This works around a crash and is not really required. Fixes https://github.com/awesomeWM/awesome/issues/127.
This commit is contained in:
parent
8531fef0d3
commit
62346a75a9
|
@ -17,7 +17,6 @@ local type = type
|
||||||
local rtable = table
|
local rtable = table
|
||||||
local pairs = pairs
|
local pairs = pairs
|
||||||
local string = string
|
local string = string
|
||||||
local glib = require("lgi").GLib
|
|
||||||
local capi =
|
local capi =
|
||||||
{
|
{
|
||||||
awesome = awesome,
|
awesome = awesome,
|
||||||
|
@ -36,11 +35,10 @@ local displayed_deprecations = {}
|
||||||
-- @param see Optional message to a new method / function to use.
|
-- @param see Optional message to a new method / function to use.
|
||||||
function util.deprecate(see)
|
function util.deprecate(see)
|
||||||
local tb = debug.traceback()
|
local tb = debug.traceback()
|
||||||
local tbhash = glib.String():append(tb):hash()
|
if displayed_deprecations[tb] then
|
||||||
if displayed_deprecations[tbhash] then
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
displayed_deprecations[tbhash] = true
|
displayed_deprecations[tb] = true
|
||||||
io.stderr:write("W: awful: function is deprecated")
|
io.stderr:write("W: awful: function is deprecated")
|
||||||
if see then
|
if see then
|
||||||
io.stderr:write(", see " .. see)
|
io.stderr:write(", see " .. see)
|
||||||
|
|
Loading…
Reference in New Issue