From: Kouhei S. <nu...@co...> - 2017-10-29 15:07:11
|
Kouhei Sutou 2017-10-30 00:06:38 +0900 (Mon, 30 Oct 2017) New Revision: 3c175a3ebc52e658a004c7ac4ce17bd2d577a9e2 https://github.com/ruby-gnome2/ruby-gnome2/commit/3c175a3ebc52e658a004c7ac4ce17bd2d577a9e2 Message: Revert "glib2: try simplifying" This reverts commit 81e143468bf0c799db8bfa1ae1f1dbf9af1df0e1. It doesn't work. Modified files: glib2/ext/glib2/rbglib_source.c Modified: glib2/ext/glib2/rbglib_source.c (+12 -1) =================================================================== --- glib2/ext/glib2/rbglib_source.c 2017-10-29 23:28:52 +0900 (8e5fbf4b7) +++ glib2/ext/glib2/rbglib_source.c 2017-10-30 00:06:38 +0900 (e4540cf78) @@ -25,6 +25,17 @@ static ID id_call; /*****************************************/ #if !GLIB_CHECK_VERSION(2,30,0) +static void +source_free(GSource *source) +{ + if (g_source_is_destroyed(source)) { + return; + } + + g_source_unref(source); + g_source_destroy(source); +} + GType g_source_get_type(void) { @@ -32,7 +43,7 @@ g_source_get_type(void) if (our_type == 0) our_type = g_boxed_type_register_static ("GSource", (GBoxedCopyFunc)g_source_ref, - (GBoxedFreeFunc)g_source_unref); + (GBoxedFreeFunc)source_free); return our_type; } #endif |