Fix for memory leak(Issue 135)
This commit is contained in:
parent
1a76bf56cb
commit
956ae249ac
1 changed files with 3 additions and 1 deletions
|
@ -146,6 +146,7 @@ namespace GtkSharp.Generation {
|
||||||
if (finalizer_needed) {
|
if (finalizer_needed) {
|
||||||
sw.WriteLine ("\t\tclass FinalizerInfo {");
|
sw.WriteLine ("\t\tclass FinalizerInfo {");
|
||||||
sw.WriteLine ("\t\t\tIntPtr handle;");
|
sw.WriteLine ("\t\t\tIntPtr handle;");
|
||||||
|
sw.WriteLine ("\t\t\tuint timeoutHandlerId;");
|
||||||
sw.WriteLine ();
|
sw.WriteLine ();
|
||||||
sw.WriteLine ("\t\t\tpublic FinalizerInfo (IntPtr handle)");
|
sw.WriteLine ("\t\t\tpublic FinalizerInfo (IntPtr handle)");
|
||||||
sw.WriteLine ("\t\t\t{");
|
sw.WriteLine ("\t\t\t{");
|
||||||
|
@ -158,6 +159,7 @@ namespace GtkSharp.Generation {
|
||||||
sw.WriteLine ("\t\t\t\t{0} (handle);", dispose.CName);
|
sw.WriteLine ("\t\t\t\t{0} (handle);", dispose.CName);
|
||||||
else if (unref != null)
|
else if (unref != null)
|
||||||
sw.WriteLine ("\t\t\t\t{0} (handle);", unref.CName);
|
sw.WriteLine ("\t\t\t\t{0} (handle);", unref.CName);
|
||||||
|
sw.WriteLine ("\t\t\t\tGLib.Timeout.Remove(timeoutHandlerId);");
|
||||||
sw.WriteLine ("\t\t\t\treturn false;");
|
sw.WriteLine ("\t\t\t\treturn false;");
|
||||||
sw.WriteLine ("\t\t\t}");
|
sw.WriteLine ("\t\t\t}");
|
||||||
sw.WriteLine ("\t\t}");
|
sw.WriteLine ("\t\t}");
|
||||||
|
@ -167,7 +169,7 @@ namespace GtkSharp.Generation {
|
||||||
sw.WriteLine ("\t\t\tif (!Owned)");
|
sw.WriteLine ("\t\t\tif (!Owned)");
|
||||||
sw.WriteLine ("\t\t\t\treturn;");
|
sw.WriteLine ("\t\t\t\treturn;");
|
||||||
sw.WriteLine ("\t\t\tFinalizerInfo info = new FinalizerInfo (Handle);");
|
sw.WriteLine ("\t\t\tFinalizerInfo info = new FinalizerInfo (Handle);");
|
||||||
sw.WriteLine ("\t\t\tGLib.Timeout.Add (50, new GLib.TimeoutHandler (info.Handler));");
|
sw.WriteLine ("\t\t\tinfo.timeoutHandlerId = GLib.Timeout.Add (50, new GLib.TimeoutHandler (info.Handler));");
|
||||||
sw.WriteLine ("\t\t}");
|
sw.WriteLine ("\t\t}");
|
||||||
sw.WriteLine ();
|
sw.WriteLine ();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue