X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ae6a64b6af83a95769363424e09d117a96a15a4c..a97d569cbbf90ba8bb293214055c3a8c19d447b5:/src/gtk/textctrl.cpp diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index 182d64038a..926d11283f 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -16,7 +16,6 @@ #include "wx/intl.h" #include "wx/log.h" #include "wx/utils.h" - #include "wx/panel.h" #include "wx/settings.h" #include "wx/math.h" #endif @@ -29,7 +28,6 @@ #include #include "wx/gtk/private.h" -#include // ---------------------------------------------------------------------------- // helpers @@ -1846,7 +1844,10 @@ void wxTextCtrl::Freeze() G_CALLBACK (gtk_text_exposed_callback), this); gtk_widget_set_sensitive(m_widget, false); g_object_ref(m_buffer); - gtk_text_view_set_buffer(GTK_TEXT_VIEW(m_text), gtk_text_buffer_new(NULL)); + GtkTextBuffer* buf_new = gtk_text_buffer_new(NULL); + gtk_text_view_set_buffer(GTK_TEXT_VIEW(m_text), buf_new); + // gtk_text_view_set_buffer adds its own reference + g_object_unref(buf_new); } } }