* ./hurricane/src/hurricane :

- Bug : memory leak in Query.h. When we do try a levelDown() remove the
        Instance locator that have been created (and is not valid).
    - To trace the numbers of Instances Locator add a counter inside the
        QuadTree. The code is commented but could be useful in case of
        another memory leak...
This commit is contained in:
Jean-Paul Chaput 2008-11-17 23:06:30 +00:00
parent 7068f0c092
commit 6d3904c0e2
4 changed files with 19 additions and 1 deletions

View File

@ -110,10 +110,12 @@ class QuadTree_GosUnder : public Collection<Go*> {
private: Box _area;
private: QuadTree* _currentQuadTree;
private: GoLocator _goLocator;
//private: static size_t _allocateds;
public: Locator();
public: Locator(const QuadTree* quadTree, const Box& area);
public: Locator(const Locator& locator);
//public: ~Locator() { _allocateds--; }
public: Locator& operator=(const Locator& locator);
@ -123,6 +125,7 @@ class QuadTree_GosUnder : public Collection<Go*> {
public: virtual bool isValid() const;
public: virtual void progress();
//public: static size_t getAllocateds() { return _allocateds; }
public: virtual string _getString() const;
@ -160,6 +163,9 @@ class QuadTree_GosUnder : public Collection<Go*> {
};
//size_t QuadTree_GosUnder::Locator::_allocateds = 0;
// ****************************************************************************************************
// QuadTree declaration
@ -204,6 +210,12 @@ QuadTree::~QuadTree()
if (_lrChild) delete _lrChild;
}
//size_t QuadTree::getLocatorAllocateds ()
// **************************************
//{
// return QuadTree_GosUnder::Locator::getAllocateds();
//}
const Box& QuadTree::getBoundingBox() const
// ****************************************
{
@ -731,6 +743,7 @@ QuadTree_GosUnder::Locator::Locator()
_currentQuadTree(NULL),
_goLocator()
{
//_allocateds++;
}
QuadTree_GosUnder::Locator::Locator(const QuadTree* quadTree, const Box& area)
@ -741,6 +754,7 @@ QuadTree_GosUnder::Locator::Locator(const QuadTree* quadTree, const Box& area)
_currentQuadTree(NULL),
_goLocator()
{
//_allocateds++;
if (_quadTree && !_area.isEmpty()) {
_currentQuadTree = _quadTree->_getFirstQuadTree(_area);
if (_currentQuadTree) {
@ -758,6 +772,7 @@ QuadTree_GosUnder::Locator::Locator(const Locator& locator)
_currentQuadTree(locator._currentQuadTree),
_goLocator(locator._goLocator)
{
//_allocateds++;
}
QuadTree_GosUnder::Locator& QuadTree_GosUnder::Locator::operator=(const Locator& locator)

View File

@ -72,6 +72,7 @@ class QuadTree {
// Accessors
// *********
//public: static size_t getLocatorAllocateds ();
public: const Box& getBoundingBox() const;
public: Gos getGos() const;
public: Gos getGosUnder(const Box& area) const;

View File

@ -243,7 +243,8 @@ namespace Hurricane {
//_tab++;
return true;
}
} else
delete locator;
return false;
}

View File

@ -589,6 +589,7 @@ namespace Hurricane {
_drawingQuery.doQuery ();
}
}
if ( isDrawableLayer("boundaries") ) {
_drawingPlanes.setPen ( Graphics::getPen ("boundaries",darkening) );
_drawingPlanes.setBrush ( Graphics::getBrush("boundaries",darkening) );