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:
Daniel Hahler 2015-02-15 10:52:35 +01:00
parent 8531fef0d3
commit 62346a75a9
1 changed files with 2 additions and 4 deletions

View File

@ -17,7 +17,6 @@ local type = type
local rtable = table
local pairs = pairs
local string = string
local glib = require("lgi").GLib
local capi =
{
awesome = awesome,
@ -36,11 +35,10 @@ local displayed_deprecations = {}
-- @param see Optional message to a new method / function to use.
function util.deprecate(see)
local tb = debug.traceback()
local tbhash = glib.String():append(tb):hash()
if displayed_deprecations[tbhash] then
if displayed_deprecations[tb] then
return
end
displayed_deprecations[tbhash] = true
displayed_deprecations[tb] = true
io.stderr:write("W: awful: function is deprecated")
if see then
io.stderr:write(", see " .. see)