Prevent dangling pointers to meters...
... This stops a crash that might occur when the checkpoint thread causes ProjectAudioManager::Stop() to execute but the project is in the process of closing.
This commit is contained in:
parent
7fcd90e351
commit
2d6db518fa
|
@ -12,6 +12,7 @@ Paul Licameli split from AudacityProject.cpp
|
|||
|
||||
#include "AudioIOBase.h"
|
||||
#include "Project.h"
|
||||
#include "widgets/MeterPanelBase.h"
|
||||
|
||||
static const AudacityProject::AttachedObjects::RegisteredFactory sAudioIOKey{
|
||||
[]( AudacityProject &parent ){
|
||||
|
|
|
@ -12,6 +12,7 @@ Paul Licameli split from AudacityProject.h
|
|||
#define __PROJECT_AUDIO_IO__
|
||||
|
||||
#include "ClientData.h" // to inherit
|
||||
#include <wx/weakref.h>
|
||||
|
||||
class AudacityProject;
|
||||
class MeterPanelBase;
|
||||
|
@ -43,8 +44,8 @@ private:
|
|||
AudacityProject &mProject;
|
||||
|
||||
// Project owned meters
|
||||
MeterPanelBase *mPlaybackMeter{};
|
||||
MeterPanelBase *mCaptureMeter{};
|
||||
wxWeakRef<MeterPanelBase> mPlaybackMeter{};
|
||||
wxWeakRef<MeterPanelBase> mCaptureMeter{};
|
||||
|
||||
int mAudioIOToken{ -1 };
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue