From dffc29bfc818854188e4e060aca3f077c70e74e0 Mon Sep 17 00:00:00 2001 From: mpv Date: Thu, 13 Nov 2014 13:47:01 +0300 Subject: [PATCH] Fix for crash on Debian Squeeze. It is quite tricky and crash is avoided if change the order of execution of methods. --- src/Model/CMakeLists.txt | 2 +- src/Model/Model_Session.cpp | 6 +++--- src/SketchPlugin/Test/TestConstraintConcidence.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Model/CMakeLists.txt b/src/Model/CMakeLists.txt index 753fd7817..3d7716827 100644 --- a/src/Model/CMakeLists.txt +++ b/src/Model/CMakeLists.txt @@ -67,7 +67,7 @@ SET(PROJECT_LIBRARIES ADD_DEFINITIONS(-DMODEL_EXPORTS ${CAS_DEFINITIONS} ${BOOST_DEFINITIONS}) -ADD_LIBRARY(Model SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS}) +ADD_LIBRARY(Model MODULE ${PROJECT_SOURCES} ${PROJECT_HEADERS}) TARGET_LINK_LIBRARIES(Model ${PROJECT_LIBRARIES}) INCLUDE_DIRECTORIES( diff --git a/src/Model/Model_Session.cpp b/src/Model/Model_Session.cpp index 2c9a5abad..2c624b8aa 100644 --- a/src/Model/Model_Session.cpp +++ b/src/Model/Model_Session.cpp @@ -101,6 +101,9 @@ FeaturePtr Model_Session::createFeature(string theFeatureID) if (this != myImpl) return myImpl->createFeature(theFeatureID); + // load all information about plugins, features and attributes + LoadPluginsInfo(); + if (myPlugins.find(theFeatureID) != myPlugins.end()) { std::pair& aPlugin = myPlugins[theFeatureID]; // plugin and doc kind if (!aPlugin.second.empty() && aPlugin.second != activeDocument()->kind()) { @@ -217,9 +220,6 @@ Model_Session::Model_Session() aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_UPDATED), 0, true); aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_DELETED), 0, true); aLoop->registerListener(this, Events_Loop::eventByName(EVENT_VALIDATOR_LOADED)); - - // load all information about plugins, features and attributes - LoadPluginsInfo(); } void Model_Session::processEvent(const boost::shared_ptr& theMessage) diff --git a/src/SketchPlugin/Test/TestConstraintConcidence.py b/src/SketchPlugin/Test/TestConstraintConcidence.py index dedb420a5..35e9ac0c8 100644 --- a/src/SketchPlugin/Test/TestConstraintConcidence.py +++ b/src/SketchPlugin/Test/TestConstraintConcidence.py @@ -84,9 +84,9 @@ assert (aLineStartPoint.y() == 0) deltaX = deltaY = 40. # move line aSession.startOperation() -aLineStartPoint.setValue(aLineStartPoint.x() + deltaX, +anArcStartPoint.setValue(aLineStartPoint.x() + deltaX, aLineStartPoint.y() + deltaY) -aLineEndPoint.setValue(aLineEndPoint.x() + deltaX, +anArcEndPoint.setValue(aLineEndPoint.x() + deltaX, aLineEndPoint.y() + deltaY) aSession.finishOperation() # check that arc's points are moved also -- 2.39.2