* ./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:
parent
7068f0c092
commit
6d3904c0e2
|
@ -110,10 +110,12 @@ class QuadTree_GosUnder : public Collection<Go*> {
|
||||||
private: Box _area;
|
private: Box _area;
|
||||||
private: QuadTree* _currentQuadTree;
|
private: QuadTree* _currentQuadTree;
|
||||||
private: GoLocator _goLocator;
|
private: GoLocator _goLocator;
|
||||||
|
//private: static size_t _allocateds;
|
||||||
|
|
||||||
public: Locator();
|
public: Locator();
|
||||||
public: Locator(const QuadTree* quadTree, const Box& area);
|
public: Locator(const QuadTree* quadTree, const Box& area);
|
||||||
public: Locator(const Locator& locator);
|
public: Locator(const Locator& locator);
|
||||||
|
//public: ~Locator() { _allocateds--; }
|
||||||
|
|
||||||
public: Locator& operator=(const Locator& locator);
|
public: Locator& operator=(const Locator& locator);
|
||||||
|
|
||||||
|
@ -123,6 +125,7 @@ class QuadTree_GosUnder : public Collection<Go*> {
|
||||||
public: virtual bool isValid() const;
|
public: virtual bool isValid() const;
|
||||||
|
|
||||||
public: virtual void progress();
|
public: virtual void progress();
|
||||||
|
//public: static size_t getAllocateds() { return _allocateds; }
|
||||||
|
|
||||||
public: virtual string _getString() const;
|
public: virtual string _getString() const;
|
||||||
|
|
||||||
|
@ -160,6 +163,9 @@ class QuadTree_GosUnder : public Collection<Go*> {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//size_t QuadTree_GosUnder::Locator::_allocateds = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ****************************************************************************************************
|
// ****************************************************************************************************
|
||||||
// QuadTree declaration
|
// QuadTree declaration
|
||||||
|
@ -204,6 +210,12 @@ QuadTree::~QuadTree()
|
||||||
if (_lrChild) delete _lrChild;
|
if (_lrChild) delete _lrChild;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//size_t QuadTree::getLocatorAllocateds ()
|
||||||
|
// **************************************
|
||||||
|
//{
|
||||||
|
// return QuadTree_GosUnder::Locator::getAllocateds();
|
||||||
|
//}
|
||||||
|
|
||||||
const Box& QuadTree::getBoundingBox() const
|
const Box& QuadTree::getBoundingBox() const
|
||||||
// ****************************************
|
// ****************************************
|
||||||
{
|
{
|
||||||
|
@ -731,6 +743,7 @@ QuadTree_GosUnder::Locator::Locator()
|
||||||
_currentQuadTree(NULL),
|
_currentQuadTree(NULL),
|
||||||
_goLocator()
|
_goLocator()
|
||||||
{
|
{
|
||||||
|
//_allocateds++;
|
||||||
}
|
}
|
||||||
|
|
||||||
QuadTree_GosUnder::Locator::Locator(const QuadTree* quadTree, const Box& area)
|
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),
|
_currentQuadTree(NULL),
|
||||||
_goLocator()
|
_goLocator()
|
||||||
{
|
{
|
||||||
|
//_allocateds++;
|
||||||
if (_quadTree && !_area.isEmpty()) {
|
if (_quadTree && !_area.isEmpty()) {
|
||||||
_currentQuadTree = _quadTree->_getFirstQuadTree(_area);
|
_currentQuadTree = _quadTree->_getFirstQuadTree(_area);
|
||||||
if (_currentQuadTree) {
|
if (_currentQuadTree) {
|
||||||
|
@ -758,6 +772,7 @@ QuadTree_GosUnder::Locator::Locator(const Locator& locator)
|
||||||
_currentQuadTree(locator._currentQuadTree),
|
_currentQuadTree(locator._currentQuadTree),
|
||||||
_goLocator(locator._goLocator)
|
_goLocator(locator._goLocator)
|
||||||
{
|
{
|
||||||
|
//_allocateds++;
|
||||||
}
|
}
|
||||||
|
|
||||||
QuadTree_GosUnder::Locator& QuadTree_GosUnder::Locator::operator=(const Locator& locator)
|
QuadTree_GosUnder::Locator& QuadTree_GosUnder::Locator::operator=(const Locator& locator)
|
||||||
|
|
|
@ -72,6 +72,7 @@ class QuadTree {
|
||||||
// Accessors
|
// Accessors
|
||||||
// *********
|
// *********
|
||||||
|
|
||||||
|
//public: static size_t getLocatorAllocateds ();
|
||||||
public: const Box& getBoundingBox() const;
|
public: const Box& getBoundingBox() const;
|
||||||
public: Gos getGos() const;
|
public: Gos getGos() const;
|
||||||
public: Gos getGosUnder(const Box& area) const;
|
public: Gos getGosUnder(const Box& area) const;
|
||||||
|
|
|
@ -243,7 +243,8 @@ namespace Hurricane {
|
||||||
//_tab++;
|
//_tab++;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
} else
|
||||||
|
delete locator;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -589,6 +589,7 @@ namespace Hurricane {
|
||||||
_drawingQuery.doQuery ();
|
_drawingQuery.doQuery ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( isDrawableLayer("boundaries") ) {
|
if ( isDrawableLayer("boundaries") ) {
|
||||||
_drawingPlanes.setPen ( Graphics::getPen ("boundaries",darkening) );
|
_drawingPlanes.setPen ( Graphics::getPen ("boundaries",darkening) );
|
||||||
_drawingPlanes.setBrush ( Graphics::getBrush("boundaries",darkening) );
|
_drawingPlanes.setBrush ( Graphics::getBrush("boundaries",darkening) );
|
||||||
|
|
Loading…
Reference in New Issue