changeset 4608:cfddd7418189

Fix another valgrind complain.
author Sebastian Geerken
date So, 26 Jun 2016 15:14:45 +0200
parents eb21d16531ce
children 286c61a84b4a
files dw/oofpositionedmgr.cc
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/dw/oofpositionedmgr.cc	So Jun 26 14:22:56 2016 +0200
+++ b/dw/oofpositionedmgr.cc	So Jun 26 15:14:45 2016 +0200
@@ -53,7 +53,17 @@
    children = new Vector<Child> (1, false);
    childrenByWidget = new HashTable<TypedPointer<Widget>, Child> (true, true);
 
-   containerAllocation = *(container->getAllocation());
+   if(container->wasAllocated()) {
+      containerAllocationState = WAS_ALLOCATED;
+      containerAllocation = *(container->getAllocation());
+   } else {
+      containerAllocationState = NOT_ALLOCATED;
+      containerAllocation.x = -1;
+      containerAllocation.y = -1;
+      containerAllocation.width = 1;
+      containerAllocation.ascent = 1;
+      containerAllocation.descent = 0;
+   }
 
    DBG_OBJ_SET_NUM ("children.size", children->size());
 }