Free ASAGI resources

parent c89e6af4
...@@ -466,6 +466,11 @@ int main( int argc, char** argv ) { ...@@ -466,6 +466,11 @@ int main( int argc, char** argv ) {
/** /**
* Finalize. * Finalize.
*/ */
#ifdef ASAGI
// Free ASAGI resources
l_scenario.deleteGrids();
#endif
// write the statistics message // write the statistics message
tools::Logger::logger.printStatisticsMessage(); tools::Logger::logger.printStatisticsMessage();
......
...@@ -53,9 +53,7 @@ public: ...@@ -53,9 +53,7 @@ public:
void open(const std::string &i_filename) void open(const std::string &i_filename)
{ {
_refCount++; if (_refCount > 0)
if (_refCount > 1)
return; return;
int l_asagiOpen = _grid->open(i_filename.c_str()); int l_asagiOpen = _grid->open(i_filename.c_str());
...@@ -66,6 +64,8 @@ public: ...@@ -66,6 +64,8 @@ public:
std::cout << "Error code: " << l_asagiOpen << std::endl; std::cout << "Error code: " << l_asagiOpen << std::endl;
assert(false); assert(false);
} }
_refCount++;
} }
void close() void close()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment