You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are circumstances when an observer is not added to correctly to an algorithm. The bug appears when adding an NObserver to an algorithm and then opening an algorithm dialog which has been set with the same algorithm.
The input checks of the algorithm dialog remove the underlying algorithm.
'''Example code structure which triggers the bug:'''
A class A contains an NObserver
in A.h
#include "Poco/NObserver.h"
class A
{
public:
A(){};
~A(){};
void showDialog();
private:
// Callback function
void handleAlgorithmFinishedNotification(const Poco::AutoPtr`<Mantid::API::Algorithm::FinishedNotification>`& pNf);
// Observer
Poco::NObserver`<A, Mantid::API::Algorithm::FinishedNotification>` m_finishedObserver;
}
The callback itself is just
void A::handleAlgorithmFinishedNotification(const Poco::AutoPtr`<Mantid::API::Algorithm::FinishedNotification>`& pNf);
{
//...never gets here
}
Inside the showDialog an algorithm is created and the m_finishedObserver is added to the list of observers of the algorithm. The algorithm is then added to an algorithm dialog
When the user presses accept on the algorithm dialog, the callback of class A is not executed, yet the callback of the AlgorithmMonitor is executed. The main places to look for a bug are the AlgorithmProxy. We noted that between original algorithm object was dropped between the addObserver call in the sample code and the addObserver call from within the AlgorithmMonitor.
Keywords: Algorithm Observer
The text was updated successfully, but these errors were encountered:
This issue was originally TRAC 10947
There are circumstances when an observer is not added to correctly to an algorithm. The bug appears when adding an NObserver to an algorithm and then opening an algorithm dialog which has been set with the same algorithm.
The input checks of the algorithm dialog remove the underlying algorithm.
'''Example code structure which triggers the bug:'''
A class A contains an NObserver
in A.h
The callback itself is just
Inside the showDialog an algorithm is created and the m_finishedObserver is added to the list of observers of the algorithm. The algorithm is then added to an algorithm dialog
When the user presses accept on the algorithm dialog, the callback of class A is not executed, yet the callback of the AlgorithmMonitor is executed. The main places to look for a bug are the AlgorithmProxy. We noted that between original algorithm object was dropped between the addObserver call in the sample code and the addObserver call from within the AlgorithmMonitor.
Keywords: Algorithm Observer
The text was updated successfully, but these errors were encountered: