diff --git a/Modules/Bundles/org.mitk.gui.qt.dicom/src/internal/QmitkDicomDataEventPublisher.cpp b/Modules/Bundles/org.mitk.gui.qt.dicom/src/internal/QmitkDicomDataEventPublisher.cpp index 9ab8555bbc..1961612b1a 100644 --- a/Modules/Bundles/org.mitk.gui.qt.dicom/src/internal/QmitkDicomDataEventPublisher.cpp +++ b/Modules/Bundles/org.mitk.gui.qt.dicom/src/internal/QmitkDicomDataEventPublisher.cpp @@ -1,50 +1,51 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "QmitkDicomDataEventPublisher.h" QmitkDicomDataEventPublisher::QmitkDicomDataEventPublisher() { } QmitkDicomDataEventPublisher::~QmitkDicomDataEventPublisher() { + delete m_EventAdmin; } void QmitkDicomDataEventPublisher::SendEvent(const ctkEvent& ctkEvent,bool synchronously) { if(synchronously) { m_EventAdmin->sendEvent(ctkEvent); }else{ m_EventAdmin->postEvent(ctkEvent); } } void QmitkDicomDataEventPublisher::SetEventAdmin(ctkPluginContext* context) { SetServiceReference(context); - if(*m_ServiceReference) + if(m_ServiceReference) { - m_EventAdmin = context->getServiceReference(*m_ServiceReference); + m_EventAdmin = context->getService(m_ServiceReference); } } void QmitkDicomDataEventPublisher::SetServiceReference(ctkPluginContext* context) { m_ServiceReference = context->getServiceReference(); } \ No newline at end of file diff --git a/Modules/Bundles/org.mitk.gui.qt.dicom/src/internal/QmitkDicomDataEventPublisher.h b/Modules/Bundles/org.mitk.gui.qt.dicom/src/internal/QmitkDicomDataEventPublisher.h index 456cf5f8ac..b9a867d37b 100644 --- a/Modules/Bundles/org.mitk.gui.qt.dicom/src/internal/QmitkDicomDataEventPublisher.h +++ b/Modules/Bundles/org.mitk.gui.qt.dicom/src/internal/QmitkDicomDataEventPublisher.h @@ -1,50 +1,50 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef QmitkDicomDataEventPublisher_H #define QmitkDicomDataEventPublisher_H #include #include #include #include class QmitkDicomDataEventPublisher { public: QmitkDicomDataEventPublisher(); virtual ~QmitkDicomDataEventPublisher(); /// @brief sends an ctkEvent default asynchronously void SendEvent(const ctkEvent& ctkEvent, bool synchronously = false ); /// @brief sets the event admin from given plugin context void SetEventAdmin(ctkPluginContext* context); private: /// @brief sets the service reference from given plugin context void SetServiceReference(ctkPluginContext* context); - ctkServiceReference* m_ServiceReference; + ctkServiceReference m_ServiceReference; ctkEventAdmin* m_EventAdmin; }; #endif // QmitkDicomDataEventPublisher_H \ No newline at end of file