Skip to content

Commit

Permalink
Define default destructors for interface classes to ensure no memory …
Browse files Browse the repository at this point in the history
…leak when attempting to delete mock objects
  • Loading branch information
robertapplin committed Mar 20, 2024
1 parent e02880c commit 8b21cbe
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ namespace MantidWidgets {

class IInstrumentConfig {
public:
virtual ~IInstrumentConfig() = default;

virtual QStringList getTechniques() = 0;
virtual void setTechniques(const QStringList &techniques) = 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ namespace MantidQt {
namespace CustomInterfaces {
class IIndirectDataReduction;

/** ILLEnergyTransfer
@author Dan Nixon
@date 23/07/2014
*/
class MANTIDQT_INDIRECT_DLL ILLEnergyTransfer : public IndirectDataReductionTab {
Q_OBJECT

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ namespace CustomInterfaces {

class MANTIDQT_INDIRECT_DLL IIETModel {
public:
virtual ~IIETModel() = default;

virtual void setInstrumentProperties(IAlgorithmRuntimeProps &properties, InstrumentData const &instData) = 0;

virtual std::vector<std::string> validateRunData(IETRunData const &runData) = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ IETPresenter::IETPresenter(IIndirectDataReduction *idrUI, IIETView *view, std::u
connect(this, SIGNAL(newInstrumentConfiguration()), this, SLOT(setInstrumentDefault()));
}

IETPresenter::~IETPresenter() = default;

void IETPresenter::setup() {}

bool IETPresenter::validateInstrumentDetails() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class MANTIDQT_INDIRECT_DLL IETPresenter : public IndirectDataReductionTab, publ

public:
IETPresenter(IIndirectDataReduction *idrUI, IIETView *view, std::unique_ptr<IIETModel> model);
~IETPresenter() override;

void setup() override;
void run() override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ IETView::IETView(QWidget *parent) {
SLOT(saveCustomGroupingClicked(std::string const &)));
}

IETView::~IETView() {}

void IETView::subscribePresenter(IIETPresenter *presenter) { m_presenter = presenter; }

IETRunData IETView::getRunData() const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class IIETPresenter;

class MANTIDQT_INDIRECT_DLL IIETView {
public:
virtual ~IIETView() = default;

virtual void subscribePresenter(IIETPresenter *presenter) = 0;

virtual IETRunData getRunData() const = 0;
Expand Down Expand Up @@ -76,7 +78,6 @@ class MANTIDQT_INDIRECT_DLL IETView : public QWidget, public IIETView {

public:
IETView(QWidget *parent = nullptr);
~IETView();

void subscribePresenter(IIETPresenter *presenter) override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class IndirectDataReductionTab;

class IIndirectDataReduction {
public:
virtual ~IIndirectDataReduction() = default;

virtual Mantid::API::MatrixWorkspace_sptr instrumentWorkspace() = 0;

virtual MantidWidgets::IInstrumentConfig *getInstrumentConfiguration() const = 0;
Expand Down
10 changes: 0 additions & 10 deletions qt/scientific_interfaces/Indirect/Reduction/IndirectTransmission.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,6 @@ namespace MantidQt {
namespace CustomInterfaces {
class IIndirectDataReduction;

/** IndirectTransmission
Provides the UI interface to the IndirectTransmissionMonitor algorithm to
calculate
sample transmission using a sample and container raw run file.
@author Samuel Jackson
@date 13/08/2013
*/
class MANTIDQT_INDIRECT_DLL IndirectTransmission : public IndirectDataReductionTab {
Q_OBJECT

Expand Down

0 comments on commit 8b21cbe

Please sign in to comment.