diff --git a/hurricane/src/hurricane/hurricane/Commons.h b/hurricane/src/hurricane/hurricane/Commons.h index a3b79b95..423f3e4c 100644 --- a/hurricane/src/hurricane/hurricane/Commons.h +++ b/hurricane/src/hurricane/hurricane/Commons.h @@ -33,6 +33,7 @@ #include #include +#include #include #include #include @@ -83,6 +84,27 @@ namespace Hurricane { + // x-------------------------------------------------------------x + // | shared_ptr<> support for DBo | + // x-------------------------------------------------------------x + + + template + class DboDestroy { + public: + inline void operator() ( DboType* dbo ) { dbo->destroy(); } + }; + + + template + class dbo_ptr : public tr1::shared_ptr { + public: + dbo_ptr ( DboType* dbo ) : tr1::shared_ptr(dbo,DboDestroy()) { } + }; + + + + // x-------------------------------------------------------------x // | Miscellaneous Utilites | // x-------------------------------------------------------------x diff --git a/hurricane/src/hviewer/CellViewer.cpp b/hurricane/src/hviewer/CellViewer.cpp index 2cf15215..a01f1779 100644 --- a/hurricane/src/hviewer/CellViewer.cpp +++ b/hurricane/src/hviewer/CellViewer.cpp @@ -331,8 +331,10 @@ namespace Hurricane { void CellViewer::setCell ( Cell* cell ) { + Name cellName = (cell) ? cell->getName() : "empty"; + list< shared_ptr >::iterator istate - = find_if ( _cellHistory.begin(), _cellHistory.end(), CellWidget::FindStateName(cell->getName()) ); + = find_if ( _cellHistory.begin(), _cellHistory.end(), CellWidget::FindStateName(cellName) ); if ( istate != _cellHistory.end() ) { emit stateChanged ( *istate );