mono / gtk-sharp

Gtk# is a Mono/.NET binding to the cross platform Gtk+ GUI toolkit and the foundation of most GUI apps built with Mono
http://www.mono-project.com/GtkSharp
Other
428 stars 140 forks source link

Fix Gtk.Menu leak #177

Closed Therzok closed 7 years ago

Therzok commented 7 years ago
public void Popup(Gtk.Widget parent_menu_shell, Gtk.Widget parent_menu_item, Gtk.MenuPositionFunc func, uint button, uint activate_time) {
    GtkSharp.MenuPositionFuncWrapper func_wrapper = new GtkSharp.MenuPositionFuncWrapper (func);
    func_wrapper.PersistUntilCalled (); // This line is added which frees the wrapper after call
    gtk_menu_popup(Handle, parent_menu_shell == null ? IntPtr.Zero : parent_menu_shell.Handle, parent_menu_item == null ? IntPtr.Zero : parent_menu_item.Handle, func_wrapper.NativeDelegate, IntPtr.Zero, button, activate_time);
}
Therzok commented 7 years ago

cc @alanmcgovern

alanmcgovern commented 7 years ago

LGTM