1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-04 18:53:24 +01:00

weak_ptr not events to avoid dangling track pointers in UIHandles

This commit is contained in:
Paul Licameli
2017-06-24 17:04:07 -04:00
parent 321919301e
commit fa5a742e22
16 changed files with 182 additions and 236 deletions

View File

@@ -12,6 +12,7 @@ Paul Licameli split from TrackPanel.cpp
#define __AUDACITY_TRACK_PANEL_RESIZE_HANDLE__
#include "tracks/ui/CommonTrackPanelCell.h"
#include "MemoryX.h"
#include "UIHandle.h"
struct HitTestResult;
@@ -46,8 +47,6 @@ public:
Result Cancel(AudacityProject *pProject) override;
void OnProjectChange(AudacityProject *pProject) override;
private:
enum Mode {
IsResizing,
@@ -56,7 +55,7 @@ private:
};
Mode mMode{ IsResizing };
Track *mpTrack{};
std::weak_ptr<Track> mpTrack;
bool mInitialMinimized{};
int mInitialTrackHeight{};