src/hbcore/gui/hbtoolbarextension.cpp
changeset 7 923ff622b8b9
parent 6 c3690ec91ef8
child 21 4633027730f5
child 34 ed14f46c0e55
--- a/src/hbcore/gui/hbtoolbarextension.cpp	Wed Jun 23 18:33:25 2010 +0300
+++ b/src/hbcore/gui/hbtoolbarextension.cpp	Tue Jul 06 14:36:53 2010 +0300
@@ -41,7 +41,6 @@
 #include <QDebug>
 #include <QGraphicsGridLayout>
 #include <QEventLoop>
-#include <QPainter>
 #include <QGraphicsLinearLayout> 
 
 /*!
@@ -112,9 +111,8 @@
 
 void HbToolBarExtensionPrivate::doLazyInit()
 {
-    Q_Q(HbToolBarExtension);
     if ( !lazyInitDone ) {
-        q->setBackgroundItem( HbStyle::P_ToolBarExtension_background );
+        setBackgroundItem(HbStyle::P_ToolBarExtension_background);
 #ifdef HB_EFFECTS
         if (!extensionEffectsLoaded){
             HbEffectInternal::add("HB_TBE", "tbe_button_click", "clicked");
@@ -214,6 +212,9 @@
     HbAction *hbAction = qobject_cast<HbAction *>( event->action() );
 
     if (hbAction) {
+        if (!q->contentWidget()) {
+            initialiseContent(); // create now to prevent mem leak below
+        }
         button = new HbToolButton(hbAction, q->contentWidget());
     } else {
         button = new HbToolButton(q->contentWidget());
@@ -338,7 +339,6 @@
  */
 HbToolBarExtension::~HbToolBarExtension()
 {
-    disconnect();
 }
 
 /*!