LCL-GTK2: Remove idle callback before destroying a widget. Issue #32985, patch from accorp.

git-svn-id: trunk@57580 -
This commit is contained in:
juha 2018-03-31 13:52:58 +00:00
parent e0f2c26d32
commit 32a9ec15de

View File

@ -4718,21 +4718,21 @@ begin
GtkWindow:=gtk_widget_get_toplevel(Widget);
if GtkWidgetIsA(GtkWindow,GTK_TYPE_WINDOW)
and (GetNearestLCLObject(PGtkWindow(GtkWindow)^.Focus_Widget)=Sender)
then begin
then
gtk_window_set_focus(PGtkWindow(GtkWindow),nil);
end;
if Sender is TCommonDialog then begin
if Sender is TCommonDialog then
DestroyCommonDialogAddOns(TCommonDialog(Sender));
end;
if GTK_IS_ENTRY(Widget) then
g_idle_remove_by_data(Widget);
// destroy widget and properties
DestroyConnectedWidget(Widget,false);
// clean up unneeded containers
if Sender is TMenuItem then begin
if Sender is TMenuItem then
DestroyEmptySubmenu(TMenuItem(Sender));
end;
// mouse click messages
if LastMouse.WinControl=Sender then