From aac581d00d4efa8c3b03fd802f22457d4127e23f Mon Sep 17 00:00:00 2001 From: pixel Date: Wed, 1 Feb 2006 18:32:25 +0000 Subject: Adding widgets new/delete scheduling - avoiding multithreading glitches. --- include/widgets.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'include/widgets.h') diff --git a/include/widgets.h b/include/widgets.h index 109f623..e46a226 100644 --- a/include/widgets.h +++ b/include/widgets.h @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: widgets.h,v 1.14 2006-01-31 17:02:39 pixel Exp $ */ +/* $Id: widgets.h,v 1.15 2006-02-01 18:32:25 pixel Exp $ */ #ifndef __WIDGETS_H__ #define __WIDGETS_H__ @@ -49,7 +49,7 @@ namespace mogltk { }; class widget : public Base { public: - virtual ~widget(); + virtual ~widget() throw (GeneralException); virtual void move(int x, int y); virtual void resize(int sx, int sy); int GetX(); @@ -113,12 +113,17 @@ namespace mogltk { Uint32 t; }; static std::vector timed_events; + static std::vector add_list; + static std::vector del_list; + static bool in_delete_loop; void computeabs(); void idraw(); bool ievent(int x, int y, event_t event); void icomputeabs(); void iresize_notify(); + + void linkme(); }; namespace widgets { @@ -385,7 +390,7 @@ namespace mogltk { virtual void do_action(mogltk::widget *) { if (a) a->do_action(parent); - delete parent; + parent->delete_me(); delete this; } private: -- cgit v1.2.3