From 7eac75402250b94069d40549fb621c65f2b6a1dc Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Wed, 25 Jun 2008 13:34:26 +0200
Subject: [PATCH] Have virtual destructor on Context, delete TabPage when deleting TabDialog.

---
 toolkit/inc/layout/layout.hxx        |    3 ++-
 toolkit/source/vclcompat/wrapper.cxx |    5 +++++
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/toolkit/inc/layout/layout.hxx b/toolkit/inc/layout/layout.hxx
index d231f54..ff223e7 100644
--- a/toolkit/inc/layout/layout.hxx
+++ b/toolkit/inc/layout/layout.hxx
@@ -73,7 +73,7 @@ class TOOLKIT_DLLPUBLIC Context
     ContextImpl *pImpl;
 public:
     Context( char const* pPath );
-    ~Context();
+    virtual ~Context();
     PeerHandle GetPeerHandle( char const* pId, sal_uInt32 nId = 0 ) const;
     void setToplevel( PeerHandle xToplevel );
     PeerHandle getToplevel();
@@ -468,6 +468,7 @@ public:
     
     TabPage( Window *pOptParent, char const* pXMLPath, char const* pId, sal_uInt32 nId = 0, SfxItemSet const* set = 0 );
     TabPage( ::Window *pOptParent, char const* pXMLPath, char const* pId, sal_uInt32 nId = 0, SfxItemSet const* set = 0 );
+    ~TabPage();
     //DECL_GET_WINDOW( TabPage );
     ::TabPage* GetTabPage();
     virtual void ActivatePage();
diff --git a/toolkit/source/vclcompat/wrapper.cxx b/toolkit/source/vclcompat/wrapper.cxx
index b0e8418..95bc106 100644
--- a/toolkit/source/vclcompat/wrapper.cxx
+++ b/toolkit/source/vclcompat/wrapper.cxx
@@ -463,6 +463,11 @@ TabPage::TabPage( ::Window *pParent, const char *pXMLPath, const char *pId, sal_
         SetParent( pParent );
 }
 
+TabPage::~TabPage()
+{
+    delete GetTabPage();
+}
+
 IMPL_GET_WINDOW( TabPage );
 
 void TabPage::ActivatePage()
-- 
1.5.6.3.317.g5d44c9.dirty


