Skip to content

Commit 069f4bf

Browse files
author
Ralph Gauges
committed
Added a cleanup call to delete the COPASI model if importing an SBML file failed.
This should fix Bug 1675
1 parent dbb3ad9 commit 069f4bf

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

copasi/CopasiDataModel/CCopasiDataModel.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Begin CVS Header
22
// $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/CopasiDataModel/CCopasiDataModel.cpp,v $
3-
// $Revision: 1.152.2.6 $
3+
// $Revision: 1.152.2.7 $
44
// $Name: $
5-
// $Author: shoops $
6-
// $Date: 2011/03/30 16:07:58 $
5+
// $Author: gauges $
6+
// $Date: 2011/07/13 19:36:18 $
77
// End CVS Header
88

99
// Copyright (C) 2011 - 2010 by Pedro Mendes, Virginia Tech Intellectual
@@ -627,12 +627,14 @@ bool CCopasiDataModel::importSBMLFromString(const std::string& sbmlDocumentText,
627627
catch (CCopasiException except)
628628
{
629629
importer.restoreFunctionDB();
630+
importer.deleteCopasiModel();
630631
throw except;
631632
}
632633

633634
if (pModel == NULL)
634635
{
635636
importer.restoreFunctionDB();
637+
importer.deleteCopasiModel();
636638
return false;
637639
}
638640

@@ -681,12 +683,14 @@ bool CCopasiDataModel::importSBML(const std::string & fileName,
681683
catch (CCopasiException except)
682684
{
683685
importer.restoreFunctionDB();
686+
importer.deleteCopasiModel();
684687
throw except;
685688
}
686689

687690
if (pModel == NULL)
688691
{
689692
importer.restoreFunctionDB();
693+
importer.deleteCopasiModel();
690694
return false;
691695
}
692696

0 commit comments

Comments
 (0)