1
0
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:
Paul Licameli
2018-01-31 09:43:53 -05:00
parent 94b97f5c95
commit 12983e1685
3 changed files with 11 additions and 20 deletions

View File

@@ -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;