changeset 4609:286c61a84b4a

Fix memory leak (OOFFloatsMgr::Float).
author Sebastian Geerken
date So, 26 Jun 2016 21:10:29 +0200
parents cfddd7418189
children 140547aa6e32
files dw/ooffloatsmgr.cc dw/ooffloatsmgr.hh
diffstat 2 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/dw/ooffloatsmgr.cc	So Jun 26 15:14:45 2016 +0200
+++ b/dw/ooffloatsmgr.cc	So Jun 26 21:10:29 2016 +0200
@@ -325,8 +325,8 @@
    this->container = container;
    this->oofmIndex = oofmIndex;
 
-   leftFloats = new SortedFloatsVector (this, LEFT);
-   rightFloats = new SortedFloatsVector (this, RIGHT);
+   leftFloats = new SortedFloatsVector (this, LEFT, true);
+   rightFloats = new SortedFloatsVector (this, RIGHT, true);
 
    DBG_OBJ_SET_NUM ("leftFloats.size", leftFloats->size());
    DBG_OBJ_SET_NUM ("rightFloats.size", rightFloats->size());
@@ -356,11 +356,11 @@
    delete tbInfos;
    delete tbInfosByOOFAwareWidget;
 
+   delete floatsByWidget;
+
    delete leftFloats;
    delete rightFloats;
-
-   delete floatsByWidget;
-
+   
    DBG_OBJ_DELETE ();
 }
 
--- a/dw/ooffloatsmgr.hh	So Jun 26 15:14:45 2016 +0200
+++ b/dw/ooffloatsmgr.hh	So Jun 26 21:10:29 2016 +0200
@@ -102,8 +102,9 @@
       Side side;
 
    public:
-      inline SortedFloatsVector (OOFFloatsMgr *oofm, Side side) :
-         lout::container::typed::Vector<Float> (1, false)
+      inline SortedFloatsVector (OOFFloatsMgr *oofm, Side side,
+                                 bool ownerOfObjects) :
+         lout::container::typed::Vector<Float> (1, ownerOfObjects)
       { this->oofm = oofm; this->side = side; }
 
       int findFloatIndex (OOFAwareWidget *lastGB, int lastExtIndex);