Skip to content

Commit

Permalink
Bugfix from downstream fluidity:
Browse files Browse the repository at this point in the history
This is 086d14c from fluidity:

Author: Tim Greaves <[email protected]>
Date:   Tue Nov 15 21:17:07 2016 +0000

    UPSTREAM BUGFIX for libspud

    To avoid a destructor being called twice (due to optimisation
removing a
    variable), deallocated is defined as static in libspud/include/spud
and then
    defined in libspud/src/spud.cpp.

    Fix supplied by James Percival (jrper)
  • Loading branch information
stephankramer committed Sep 20, 2017
1 parent e78679b commit 216b6d5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/spud
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ namespace Spud{

};

bool deallocated;
static bool deallocated;
Option* options;

};
Expand Down
6 changes: 5 additions & 1 deletion src/spud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ namespace Spud{

// OptionManager CLASS METHODS

// PRIVATE VARIABLES

bool OptionManager::deallocated = false;

// PUBLIC METHODS

void OptionManager::clear_options() {
Expand Down Expand Up @@ -674,7 +678,7 @@ namespace Spud{

OptionManager::Option::~Option(){
for(deque< pair<string, Option*> >::iterator it=children.begin();it!=children.end();++it){
delete it->second;
if(it->second) delete it->second;
}

return;
Expand Down

0 comments on commit 216b6d5

Please sign in to comment.