diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2010-02-20 17:40:07 +0000 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2010-02-20 17:40:07 +0000 |
| commit | 7ae0c170ad2f63ac7e27d0496cd9c167e2bd0cbd (patch) | |
| tree | 0d51f2e36cc11714c6ee5923f8d52c6a9a3793dc /src/Fl.cxx | |
| parent | c7a1aead4c9b79882b64267b492b1f9d87ab22d0 (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.cxx | 16 |
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; } /** |
