summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2010-02-19 21:08:34 +0000
committerMatthias Melcher <fltk@matthiasm.com>2010-02-19 21:08:34 +0000
commitb737694f4a0ce90cf7a6b3539327903b96152ca8 (patch)
treefa17b68384e479a0e28ae1f44162434ba8be1dad
parent6cea1f402d7d3bf62b042ff1abff3cb2c1343b31 (diff)
test/Editor was freeing the text buffer too soon and no clearing callbacks. (STR #2294)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7106 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--CHANGES2
-rw-r--r--test/editor.cxx11
2 files changed, 10 insertions, 3 deletions
diff --git a/CHANGES b/CHANGES
index 2b061a2fe..1b88620fb 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,7 @@
CHANGES IN FLTK 1.3.0
+ - Fixed crash in test/Editor when freeing buffer
+ too soon (STR #2294)
- Fixed Fl_Preferences Cygwin wide character bug (STR #2164)
- Fixed sorting in Fl_Browser - last item would not
be sorted (STR #2300)
diff --git a/test/editor.cxx b/test/editor.cxx
index a361295df..12cc4ccb9 100644
--- a/test/editor.cxx
+++ b/test/editor.cxx
@@ -609,14 +609,19 @@ void paste_cb(Fl_Widget*, void* v) {
int num_windows = 0;
void close_cb(Fl_Widget*, void* v) {
- Fl_Window* w = (Fl_Window*)v;
- if (num_windows == 1 && !check_save()) {
- return;
+ EditorWindow* w = (EditorWindow*)v;
+
+ if (num_windows == 1) {
+ if (!check_save())
+ return;
}
w->hide();
+ w->editor->buffer(0);
+ textbuf->remove_modify_callback(style_update, w->editor);
textbuf->remove_modify_callback(changed_cb, w);
Fl::delete_widget(w);
+
num_windows--;
if (!num_windows) exit(0);
}