awesome/common
Uli Schlachter 6f1df7a3ad Fix disconnecting not connected signals (#950)
When a function is disconnected from a signal ("disconnect_signal") that is not
actually connected to the function, two things happened:

1. The attempt to remove the function from the signal array didn't do anything
2. Unreferencing the function noticed that the function wasn't referenced

The second step printed a big, fat scary warning.

Actually, this has the possibility of causing errors. For example, in the
following code, awesome would wrongly unreference the function at the
disconnect_signal() call and might later still try to call it when the
"refresh" signal is emitted:

do
    local function f() end
    awesome.connect_signal("refresh", f)
    awesome.disconnect_signal("debug::error", f)
end

Fix this by making signal_disconnect() return a boolean value indicating if it
actually did something. All callers are fixed to use this value and only update
the reference counts if something was actually disconnected.

Fixes: https://github.com/awesomeWM/awesome/issues/814
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-06-09 00:03:08 +02:00
..
array.h Deprecate signal_add() on C-API objects 2016-06-04 17:51:45 +02:00
atoms.c remove encoding=utf-8 from modelines 2011-09-11 17:34:09 +02:00
atoms.h remove encoding=utf-8 from modelines 2011-09-11 17:34:09 +02:00
atoms.list Keep client order across restarts 2015-07-27 13:47:09 +02:00
backtrace.c remove encoding=utf-8 from modelines 2011-09-11 17:34:09 +02:00
backtrace.h remove encoding=utf-8 from modelines 2011-09-11 17:34:09 +02:00
buffer.c Add a vim modeline to all C source 2015-12-12 17:42:16 +01:00
buffer.h Add a vim modeline to all C source 2015-12-12 17:42:16 +01:00
luaclass.c Fix disconnecting not connected signals (#950) 2016-06-09 00:03:08 +02:00
luaclass.h Deprecate signal_add() on C-API objects 2016-06-04 17:51:45 +02:00
lualib.c Add a vim modeline to all C source 2015-12-12 17:42:16 +01:00
lualib.h minor: fix/improve doc comments 2015-07-12 17:42:53 +02:00
luaobject.c Fix disconnecting not connected signals (#950) 2016-06-09 00:03:08 +02:00
luaobject.h Deprecate signal_add() on C-API objects 2016-06-04 17:51:45 +02:00
signal.h Fix disconnecting not connected signals (#950) 2016-06-09 00:03:08 +02:00
util.c Add timestamps to messages on stderr (#602) 2015-12-31 15:38:17 +01:00
util.h Add timestamps to messages on stderr (#602) 2015-12-31 15:38:17 +01:00
version.c Remove useless information from awesome -v 2015-12-01 20:17:21 +01:00
version.h Add a vim modeline to all C source 2015-12-12 17:42:16 +01:00
xcursor.c Switch from libXcursor to libxcb-cursor 2013-09-19 16:48:10 +02:00
xcursor.h Switch from libXcursor to libxcb-cursor 2013-09-19 16:48:10 +02:00
xembed.c Properly support the XEMBED_MAPPED bit 2016-05-31 08:55:42 +02:00
xembed.h Clean up header includes 2014-03-30 20:07:48 +02:00
xutil.c Remove some unused fields from globalconf 2015-12-22 17:25:45 +01:00
xutil.h xutil.h: Add defines for valid coordinates and sizes 2016-04-17 13:48:24 +02:00