From 7857769f96fa8bd6d9954ba5b59bf95dee0b93ec Mon Sep 17 00:00:00 2001 From: Steve Daulton Date: Mon, 8 Jul 2019 00:38:19 +0100 Subject: [PATCH] Workaround for kDevelop crash Thanks to PRL for the fix. --- .../playabletrack/ui/PlayableTrackControls.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/tracks/playabletrack/ui/PlayableTrackControls.cpp b/src/tracks/playabletrack/ui/PlayableTrackControls.cpp index 1e4e3cc0b..03879066e 100644 --- a/src/tracks/playabletrack/ui/PlayableTrackControls.cpp +++ b/src/tracks/playabletrack/ui/PlayableTrackControls.cpp @@ -195,13 +195,14 @@ void PlayableTrackControls::GetMuteSoloRect } +#include const TCPLines& PlayableTrackControls::StaticTCPLines() { - static const struct PlayableTrackTCPLines - : TCPLines { PlayableTrackTCPLines() { - (TCPLines&)*this = - CommonTrackControls::StaticTCPLines(); - insert( end(), { + static TCPLines playableTrackTCPLines; + static std::once_flag flag; + std::call_once( flag, []{ + playableTrackTCPLines = CommonTrackControls::StaticTCPLines(); + playableTrackTCPLines.insert( playableTrackTCPLines.end(), { #ifdef EXPERIMENTAL_DA // DA: Has Mute and Solo on separate lines. { TCPLine::kItemMute, kTrackInfoBtnSize + 1, 1, @@ -214,6 +215,6 @@ const TCPLines& PlayableTrackControls::StaticTCPLines() #endif } ); - } } playableTrackTCPLines; + } ); return playableTrackTCPLines; }