# HG changeset patch # User Sebastien Jodogne # Date 1411573229 -7200 # Node ID c71d25e6a63c5a61b8af3eec165a1c9dbc479983 # Parent 5b2d8c280ac20bc3429db8326dea6530021437aa improvement diff -r 5b2d8c280ac2 -r c71d25e6a63c Plugins/Engine/OrthancPlugins.cpp --- a/Plugins/Engine/OrthancPlugins.cpp Wed Sep 24 17:37:44 2014 +0200 +++ b/Plugins/Engine/OrthancPlugins.cpp Wed Sep 24 17:40:29 2014 +0200 @@ -375,18 +375,25 @@ ResourceType resourceType, const std::string& publicId) { + OrthancPluginChangeType c; + OrthancPluginResourceType r; + + try + { + c = Convert(changeType); + r = Convert(resourceType); + } + catch (OrthancException&) + { + // This change type or resource type is not supported by the plugin SDK + return; + } + for (PImpl::OnChangeCallbacks::const_iterator callback = pimpl_->onChangeCallbacks_.begin(); callback != pimpl_->onChangeCallbacks_.end(); ++callback) { - try - { - (*callback) (Convert(changeType), Convert(resourceType), publicId.c_str()); - } - catch (OrthancException&) - { - // This change type or resource type is not supported by the plugin SDK - } + (*callback) (c, r, publicId.c_str()); } }