File tree Expand file tree Collapse file tree 2 files changed +21
-9
lines changed
Expand file tree Collapse file tree 2 files changed +21
-9
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,22 @@ string BaseAddressDetectionConfidenceToString(BNBaseAddressDetectionConfidence l
2929}
3030
3131
32+ BaseAddressDetectionThread::BaseAddressDetectionThread (BaseAddressDetectionQtInputs* widgetInputs,
33+ BinaryNinja::Ref<BinaryNinja::BinaryView> bv)
34+ {
35+ m_inputs = widgetInputs;
36+ m_view = bv;
37+ m_baseDetection = new BinaryNinja::BaseAddressDetection (m_view);
38+ }
39+
40+
41+ BaseAddressDetectionThread::~BaseAddressDetectionThread ()
42+ {
43+ if (m_baseDetection)
44+ delete m_baseDetection;
45+ }
46+
47+
3248void BaseAddressDetectionThread::run ()
3349{
3450 BaseAddressDetectionQtResults results;
Original file line number Diff line number Diff line change @@ -40,18 +40,14 @@ class BaseAddressDetectionThread : public QThread
4040{
4141 Q_OBJECT
4242 BinaryNinja::Ref<BinaryNinja::BinaryView> m_view;
43- BinaryNinja::BaseAddressDetection* m_baseDetection;
43+ BinaryNinja::BaseAddressDetection* m_baseDetection = nullptr ;
4444 BaseAddressDetectionQtInputs* m_inputs {};
4545 void run () override ;
4646
4747public:
48- BaseAddressDetectionThread (BaseAddressDetectionQtInputs* widgetInputs, BinaryNinja::Ref<BinaryNinja::BinaryView> bv)
49- {
50- m_inputs = widgetInputs;
51- m_view = bv;
52- m_baseDetection = new BinaryNinja::BaseAddressDetection (m_view);
53- }
54-
48+ BaseAddressDetectionThread (BaseAddressDetectionQtInputs* widgetInputs,
49+ BinaryNinja::Ref<BinaryNinja::BinaryView> bv);
50+ ~BaseAddressDetectionThread ();
5551 void Abort () { m_baseDetection->Abort (); }
5652 bool IsAborted () { return m_baseDetection->IsAborted (); }
5753
@@ -89,4 +85,4 @@ class BaseAddressDetectionWidget : public QWidget
8985
9086public:
9187 BaseAddressDetectionWidget (QWidget* parent, BinaryNinja::Ref<BinaryNinja::BinaryView> bv);
92- };
88+ };
You can’t perform that action at this time.
0 commit comments