summaryrefslogtreecommitdiff
path: root/src/Fl.cxx
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2010-02-20 17:40:07 +0000
committerAlbrecht Schlosser <albrechts.fltk@online.de>2010-02-20 17:40:07 +0000
commit7ae0c170ad2f63ac7e27d0496cd9c167e2bd0cbd (patch)
tree0d51f2e36cc11714c6ee5923f8d52c6a9a3793dc /src/Fl.cxx
parentc7a1aead4c9b79882b64267b492b1f9d87ab22d0 (diff)
Added Fl_Widget_Tracker in handle() methods etc. to avoid accessing widgets
after deletion (STR #1306). This is all I could find, but maybe there are more places in the code. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7115 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl.cxx')
-rw-r--r--src/Fl.cxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx
index c8b359c6b..9670e29c2 100644
--- a/src/Fl.cxx
+++ b/src/Fl.cxx
@@ -44,9 +44,9 @@
#import <Cocoa/Cocoa.h>
#endif
-#ifdef DEBUG
+#if defined(DEBUG) || defined(DEBUG_WATCH)
# include <stdio.h>
-#endif // DEBUG
+#endif // DEBUG || DEBUG_WATCH
#ifdef WIN32
# include <ole2.h>
@@ -1648,11 +1648,11 @@ void Fl::watch_widget_pointer(Fl_Widget *&w)
widget_watch = (Fl_Widget***)realloc(widget_watch, sizeof(Fl_Widget**)*max_widget_watch);
}
widget_watch[num_widget_watch++] = wp;
-#ifdef DEBUG
+#ifdef DEBUG_WATCH
printf ("\nwatch_widget_pointer: (%d/%d) %8p => %8p\n",
num_widget_watch,num_widget_watch,wp,*wp);
fflush(stdout);
-#endif // DEBUG
+#endif // DEBUG_WATCH
}
/**
@@ -1674,18 +1674,18 @@ void Fl::release_widget_pointer(Fl_Widget *&w)
if (j<i) widget_watch[j] = widget_watch[i]; // fill gap
j++;
}
-#ifdef DEBUG
+#ifdef DEBUG_WATCH
else { // found widget pointer
printf ("release_widget_pointer: (%d/%d) %8p => %8p\n",
i+1,num_widget_watch,wp,*wp);
}
-#endif //DEBUG
+#endif //DEBUG_WATCH
}
num_widget_watch = j;
-#ifdef DEBUG
+#ifdef DEBUG_WATCH
printf (" num_widget_watch = %d\n\n",num_widget_watch);
fflush(stdout);
-#endif // DEBUG
+#endif // DEBUG_WATCH
return;
}
/**