Skip to content

Commit

Permalink
Respect activation priority also on deactivation
Browse files Browse the repository at this point in the history
  • Loading branch information
Al2Klimov committed Feb 6, 2019
1 parent 1eaad06 commit 8ad1717
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/base/configobject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "base/workqueue.hpp"
#include "base/context.hpp"
#include "base/application.hpp"
#include <algorithm>
#include <fstream>
#include <boost/exception/errinfo_api_function.hpp>
#include <boost/exception/errinfo_errno.hpp>
Expand Down Expand Up @@ -617,7 +618,13 @@ void ConfigObject::RestoreObjects(const String& filename, int attributeTypes)

void ConfigObject::StopObjects()
{
for (const Type::Ptr& type : Type::GetAllTypes()) {
auto types = Type::GetAllTypes();

std::sort(types.begin(), types.end(), [](const Type::Ptr& a, const Type::Ptr& b) {
return a->GetActivationPriority() > b->GetActivationPriority();
});

for (const Type::Ptr& type : types) {
auto *dtype = dynamic_cast<ConfigType *>(type.get());

if (!dtype)
Expand Down

0 comments on commit 8ad1717

Please sign in to comment.