From 6cf694d2da5a661373a58c70e3d8e07cc8223eed Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 18 May 2012 23:08:34 +0000 Subject: Final refactoring and implementation of delayed window deletion logic. Works worse now, but the changes are important and need to be checked in now git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4747 42af7a65-404d-4744-a932-0658087f49c3 --- NxWidgets/libnxwidgets/include/ibitmap.hxx | 9 +++++++++ NxWidgets/libnxwidgets/include/ilistbox.hxx | 8 ++++++++ NxWidgets/libnxwidgets/include/ilistdataeventhandler.hxx | 9 +++++++++ NxWidgets/libnxwidgets/include/inxwindow.hxx | 8 ++++++++ NxWidgets/libnxwidgets/include/iscrollable.hxx | 9 +++++++++ NxWidgets/libnxwidgets/include/islider.hxx | 8 ++++++++ NxWidgets/libnxwidgets/include/itextbox.hxx | 8 ++++++++ NxWidgets/libnxwidgets/src/ccallback.cxx | 2 +- NxWidgets/libnxwidgets/src/cnxwindow.cxx | 2 +- 9 files changed, 61 insertions(+), 2 deletions(-) (limited to 'NxWidgets/libnxwidgets') diff --git a/NxWidgets/libnxwidgets/include/ibitmap.hxx b/NxWidgets/libnxwidgets/include/ibitmap.hxx index 5eaa5b3c9..923df407a 100644 --- a/NxWidgets/libnxwidgets/include/ibitmap.hxx +++ b/NxWidgets/libnxwidgets/include/ibitmap.hxx @@ -102,6 +102,15 @@ namespace NXWidgets class IBitmap { public: + /** + * A virtual destructor is required in order to override the IBitmap + * destructor. We do this because if we delete IBitmap, we want the + * destructor of the class that inherits from IBitmap to run, not this + * one. + */ + + virtual ~IBitmap(void) { } + /** * Get the bitmap's color format. * diff --git a/NxWidgets/libnxwidgets/include/ilistbox.hxx b/NxWidgets/libnxwidgets/include/ilistbox.hxx index 9184f23c8..0eb33bc3b 100644 --- a/NxWidgets/libnxwidgets/include/ilistbox.hxx +++ b/NxWidgets/libnxwidgets/include/ilistbox.hxx @@ -102,6 +102,14 @@ namespace NXWidgets class IListBox { public: + /** + * A virtual destructor is required in order to override the IListBox + * destructor. We do this because if we delete IListBox, we want the + * destructor of the class that inherits from IListBox to run, not this + * one. + */ + + virtual ~IListBox(void) { } /** * Add a new option to the widget using default colors. diff --git a/NxWidgets/libnxwidgets/include/ilistdataeventhandler.hxx b/NxWidgets/libnxwidgets/include/ilistdataeventhandler.hxx index b6119a2ae..26bf1411b 100644 --- a/NxWidgets/libnxwidgets/include/ilistdataeventhandler.hxx +++ b/NxWidgets/libnxwidgets/include/ilistdataeventhandler.hxx @@ -103,6 +103,15 @@ namespace NXWidgets class IListDataEventHandler { public: + /** + * A virtual destructor is required in order to override the IListDataEventHandler + * destructor. We do this because if we delete IListDataEventHandler, we want the + * destructor of the class that inherits from IListDataEventHandler to run, not this + * one. + */ + + virtual ~IListDataEventHandler(void) { } + /** * Handle data changes. * diff --git a/NxWidgets/libnxwidgets/include/inxwindow.hxx b/NxWidgets/libnxwidgets/include/inxwindow.hxx index c38052de0..750994a71 100644 --- a/NxWidgets/libnxwidgets/include/inxwindow.hxx +++ b/NxWidgets/libnxwidgets/include/inxwindow.hxx @@ -79,6 +79,14 @@ namespace NXWidgets class INxWindow { public: + /** + * A virtual destructor is required in order to override the INxWindow + * destructor. We do this because if we delete INxWindow, we want the + * destructor of the class that inherits from INxWindow to run, not this + * one. + */ + + virtual ~INxWindow(void) { } /** * Creates a new window. Window creation is separate from diff --git a/NxWidgets/libnxwidgets/include/iscrollable.hxx b/NxWidgets/libnxwidgets/include/iscrollable.hxx index 21a69e487..b0e65a9db 100644 --- a/NxWidgets/libnxwidgets/include/iscrollable.hxx +++ b/NxWidgets/libnxwidgets/include/iscrollable.hxx @@ -102,6 +102,15 @@ namespace NXWidgets class IScrollable { public: + /** + * A virtual destructor is required in order to override the IScrollable + * destructor. We do this because if we delete IScrollable, we want the + * destructor of the class that inherits from IScrollable to run, not this + * one. + */ + + virtual ~IScrollable(void) { } + /** * Gets the x coordinate of the virtual canvas. * diff --git a/NxWidgets/libnxwidgets/include/islider.hxx b/NxWidgets/libnxwidgets/include/islider.hxx index 5ea821e42..5a9340923 100644 --- a/NxWidgets/libnxwidgets/include/islider.hxx +++ b/NxWidgets/libnxwidgets/include/islider.hxx @@ -99,6 +99,14 @@ namespace NXWidgets class ISlider { public: + /** + * A virtual destructor is required in order to override the ISlider + * destructor. We do this because if we delete ISlider, we want the + * destructor of the class that inherits from ISlider to run, not this + * one. + */ + + virtual ~ISlider(void) { } /** * Get the smallest value that the slider can represent. diff --git a/NxWidgets/libnxwidgets/include/itextbox.hxx b/NxWidgets/libnxwidgets/include/itextbox.hxx index 78de7e502..0e2e7b824 100644 --- a/NxWidgets/libnxwidgets/include/itextbox.hxx +++ b/NxWidgets/libnxwidgets/include/itextbox.hxx @@ -115,6 +115,14 @@ namespace NXWidgets class ITextBox { public: + /** + * A virtual destructor is required in order to override the ITextBox + * destructor. We do this because if we delete ITextBox, we want the + * destructor of the class that inherits from ITextBox to run, not this + * one. + */ + + virtual ~ITextBox(void) { } /** * Sets the cursor display mode. diff --git a/NxWidgets/libnxwidgets/src/ccallback.cxx b/NxWidgets/libnxwidgets/src/ccallback.cxx index 09dc53a5a..32c5b7d64 100644 --- a/NxWidgets/libnxwidgets/src/ccallback.cxx +++ b/NxWidgets/libnxwidgets/src/ccallback.cxx @@ -36,7 +36,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/NxWidgets/libnxwidgets/src/cnxwindow.cxx b/NxWidgets/libnxwidgets/src/cnxwindow.cxx index 599335972..5ba4d734c 100644 --- a/NxWidgets/libnxwidgets/src/cnxwindow.cxx +++ b/NxWidgets/libnxwidgets/src/cnxwindow.cxx @@ -36,7 +36,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include -- cgit v1.2.3