Fix memory leak, scene graph layers are never deleted from memory 15/115115/11
authorNick Holland <nick.holland@partner.samsung.com>
Thu, 16 Feb 2017 09:21:52 +0000 (09:21 +0000)
committerNick Holland <nick.holland@partner.samsung.com>
Mon, 27 Feb 2017 10:44:46 +0000 (10:44 +0000)
commit434e7acfb634957e97a69aa86bfccfc973aefd4b
tree217efd90eb5a0d3a261bb0d98e06f3acbb8cb612
parentb0d793f4078ebd270f62c62c0915db58ccd20901
Fix memory leak, scene graph layers are never deleted from memory

Reported by Valgrind.
We have a memory pool for Nodes which works fine
for creating /deleting nodes.

Scene Graph Layers inherit from Nodes, but don't use
the memory pool.

However when either a Node or a Layer is deleted, the overloaded
Node operator delete( void* ptr ) is called, which tries to free
the Node from the memory pool.
Unfortunately for Layer it was never in the memory pool so no
memory is free'd.

Fix includes:
node destructor is protected
layer destructor is private
node delete operator removed

Change-Id: Icfe83f35b4f29d5b774cde392ff976ad299481c5
dali/devel-api/common/owner-container.h
dali/internal/update/common/discard-queue.h
dali/internal/update/manager/update-manager.cpp
dali/internal/update/nodes/node-declarations.h
dali/internal/update/nodes/node.cpp
dali/internal/update/nodes/node.h
dali/internal/update/nodes/scene-graph-layer.cpp
dali/internal/update/nodes/scene-graph-layer.h