Free ASAGI resources

parent c89e6af4
......@@ -466,6 +466,11 @@ int main( int argc, char** argv ) {
/**
* Finalize.
*/
#ifdef ASAGI
// Free ASAGI resources
l_scenario.deleteGrids();
#endif
// write the statistics message
tools::Logger::logger.printStatisticsMessage();
......
......@@ -53,9 +53,7 @@ public:
void open(const std::string &i_filename)
{
_refCount++;
if (_refCount > 1)
if (_refCount > 0)
return;
int l_asagiOpen = _grid->open(i_filename.c_str());
......@@ -66,6 +64,8 @@ public:
std::cout << "Error code: " << l_asagiOpen << std::endl;
assert(false);
}
_refCount++;
}
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