diff --git a/ext/or-tools/constraint.cpp b/ext/or-tools/constraint.cpp index 8a0ee82..2b9f7c4 100644 --- a/ext/or-tools/constraint.cpp +++ b/ext/or-tools/constraint.cpp @@ -418,6 +418,7 @@ void init_constraint(Rice::Module& m) { Model m; std::atomic stopped(false); + std::atomic* stopped2 = &stopped; if (!callback.is_nil()) { // TODO figure out how to use callback with multiple cores @@ -434,7 +435,7 @@ void init_constraint(Rice::Module& m) { // TODO find a better way to do this callback.call("response=", r); callback.call("on_solution_callback"); - stopped = callback.attr_get("@stopped"); + *stopped2 = callback.attr_get("@stopped"); }) ); }