From: Arnaud Giersch Date: Tue, 2 Apr 2019 09:51:13 +0000 (+0200) Subject: Call set_remains() before set_state(). X-Git-Tag: v3.22.1~28 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/b32344ed85aec79b48fdb3c22df878307f13f6f7 Call set_remains() before set_state(). set_state() may call plugin callbacks, which can destroy the action (more or less direclty), as seen with github issue #326. --- diff --git a/src/kernel/resource/Action.cpp b/src/kernel/resource/Action.cpp index 3ea572b2de..cf86b5c73a 100644 --- a/src/kernel/resource/Action.cpp +++ b/src/kernel/resource/Action.cpp @@ -47,8 +47,8 @@ Action::~Action() void Action::finish(Action::State state) { finish_time_ = surf_get_clock(); - set_state(state); set_remains(0); + set_state(state); } Action::State Action::get_state() const