mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-25 15:53:52 +02:00
Use wxWeakRef to avoid dangling pointer
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include <wx/atomic.h>
|
||||
#include <wx/weakref.h>
|
||||
|
||||
#ifdef USE_MIDI
|
||||
|
||||
@@ -410,7 +411,6 @@ class AUDACITY_DLL_API AudioIO final {
|
||||
bool IsAvailable(AudacityProject *projecT);
|
||||
void SetCaptureMeter(AudacityProject *project, MeterPanel *meter);
|
||||
void SetPlaybackMeter(AudacityProject *project, MeterPanel *meter);
|
||||
MeterPanel * GetCaptureMeter();
|
||||
|
||||
private:
|
||||
/** \brief Set the current VU meters - this should be done once after
|
||||
@@ -694,7 +694,7 @@ private:
|
||||
PaError mLastPaError;
|
||||
|
||||
AudacityProject *mOwningProject;
|
||||
MeterPanel *mInputMeter;
|
||||
wxWeakRef<MeterPanel> mInputMeter{};
|
||||
MeterPanel *mOutputMeter;
|
||||
bool mUpdateMeters;
|
||||
volatile bool mUpdatingMeters;
|
||||
|
||||
Reference in New Issue
Block a user