mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-21 14:49:16 +02:00
gmain: fix some silly code in a programmer-error case
Previously if a source got finalized while still attached to a context, it would warn and re-ref the source. But then it just freed it anyway... So keep the warning but drop the re-ref. https://bugzilla.gnome.org/show_bug.cgi?id=634239
This commit is contained in:
parent
b358202856
commit
ece936e84d
@ -1511,13 +1511,12 @@ g_source_unref_internal (GSource *source,
|
|||||||
source->callback_data = NULL;
|
source->callback_data = NULL;
|
||||||
source->callback_funcs = NULL;
|
source->callback_funcs = NULL;
|
||||||
|
|
||||||
if (context && !SOURCE_DESTROYED (source))
|
if (context)
|
||||||
{
|
{
|
||||||
g_warning (G_STRLOC ": ref_count == 0, but source is still attached to a context!");
|
if (!SOURCE_DESTROYED (source))
|
||||||
source->ref_count++;
|
g_warning (G_STRLOC ": ref_count == 0, but source was still attached to a context!");
|
||||||
|
g_source_list_remove (source, context);
|
||||||
}
|
}
|
||||||
else if (context)
|
|
||||||
g_source_list_remove (source, context);
|
|
||||||
|
|
||||||
if (source->source_funcs->finalize)
|
if (source->source_funcs->finalize)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user