[partition] Call the helpers in the right order.

This fixes the crash by calling the model-reset first, then
refreshing. Previously, the destructors that do the work
were still being called in the wrong order.

FIXES #1019
This commit is contained in:
Adriaan de Groot 2018-09-03 15:21:30 -04:00
parent 13015096d1
commit c104d14086

View File

@ -79,8 +79,8 @@ class OperationHelper
{ {
public: public:
OperationHelper( PartitionModel* model, PartitionCoreModule* core ) OperationHelper( PartitionModel* model, PartitionCoreModule* core )
: m_modelHelper( model ) : m_coreHelper( core )
, m_coreHelper( core ) , m_modelHelper( model )
{ {
} }
@ -89,9 +89,10 @@ public:
private: private:
// Keep these in order: first the model needs to finish, // Keep these in order: first the model needs to finish,
// then refresh is called. // then refresh is called. Remember that destructors are
PartitionModel::ResetHelper m_modelHelper; // called in *reverse* order of declaration in this class.
PartitionCoreModule::RefreshHelper m_coreHelper; PartitionCoreModule::RefreshHelper m_coreHelper;
PartitionModel::ResetHelper m_modelHelper;
} ; } ;