fix memory leak in Freeze
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42108 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -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 <ctype.h>
|
||||
|
||||
#include "wx/gtk/private.h"
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user