com gtk/php-gtk: Fix for bug #37787 (Memleak when using timeout in a class): main/php_gtk.c

[email protected] (David Soria Parra)
Newsgroups php.gtk.cvs
Message-ID <[email protected]>
Commit:    21403874bde3c429990b714b75382561b2e2b33a
Author:    Andrei Zmievski <[email protected]>         Thu, 15 Jun 2006 04:28:34 +0000
Parents:   e1ba6203538b5cee00ab4d218da5f73f49a342f1
Branches:  master

Link:       http://git.php.net/?p=gtk/php-gtk.git;a=commitdiff;h=21403874bde3c429990b714b75382561b2e2b33a

Log:
Fix for bug #37787 (Memleak when using timeout in a class)

Bugs:
https://bugs.php.net/37787

Changed paths:
  M  main/php_gtk.c


Diff:
21403874bde3c429990b714b75382561b2e2b33a
diff --git a/main/php_gtk.c b/main/php_gtk.c
index 54c4a17..7b54ca6 100644
--- a/main/php_gtk.c
+++ b/main/php_gtk.c
@@ -211,6 +211,15 @@ PHP_RINIT_FUNCTION(gtk)
 /* Remove if there's nothing to do at request end */
 PHP_RSHUTDOWN_FUNCTION(gtk)
 {
+	GMainContext *context;
+
+	/*
+	 * Looks like we have to free up the default main context ourselves, in case
+	 * gtk::main() was never called by a script.
+	 */
+	context = g_main_context_default();
+	g_main_context_unref(context);
+
 	return SUCCESS;
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.