From 8c51e56248269e1499cfa91ff78d1eb4eed0da12 Mon Sep 17 00:00:00 2001 From: "v.audacity" Date: Sat, 24 Jul 2010 23:21:51 +0000 Subject: [PATCH] Switch to calling Yield via wxTheApp instead of wxGetApp(). Simpler to use pointer, AudacityApp doesn't override Yield, and this fixes compile error on VC++ Unicode Release. --- lib-src/lib-widget-extra/NonGuiThread.cpp | 2 +- src/AudioIO.cpp | 2 +- src/Benchmark.cpp | 10 +++++----- src/CaptureEvents.cpp | 2 +- src/export/ExportCL.cpp | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib-src/lib-widget-extra/NonGuiThread.cpp b/lib-src/lib-widget-extra/NonGuiThread.cpp index e63a7ed9c..9b15de524 100644 --- a/lib-src/lib-widget-extra/NonGuiThread.cpp +++ b/lib-src/lib-widget-extra/NonGuiThread.cpp @@ -66,7 +66,7 @@ void NonGuiThread::RunInThread(tGenericFn pFn) { wxMilliSleep( 100 ); //traits->AlwaysYield(); - wxGetApp().Yield(); + wxTheApp->Yield(); } #ifdef WXMSW traits->AfterChildWaitLoop(cookie); diff --git a/src/AudioIO.cpp b/src/AudioIO.cpp index b5d540dc7..59b039b01 100644 --- a/src/AudioIO.cpp +++ b/src/AudioIO.cpp @@ -377,7 +377,7 @@ AudioIO::~AudioIO() /* Delete is a "graceful" way to stop the thread. (Kill is the not-graceful way.) */ - wxGetApp().Yield(); + wxTheApp->Yield(); mThread->Delete(); if(mSilentBuf) diff --git a/src/Benchmark.cpp b/src/Benchmark.cpp index e94ac045f..8819ddaca 100644 --- a/src/Benchmark.cpp +++ b/src/Benchmark.cpp @@ -367,7 +367,7 @@ void BenchmarkDialog::OnRun( wxCommandEvent &event ) Printf(wxT("Preparing...\n")); - wxGetApp().Yield(); + wxTheApp->Yield(); FlushPrint(); int i, b, v; @@ -400,7 +400,7 @@ void BenchmarkDialog::OnRun( wxCommandEvent &event ) //t->Debug(); Printf(wxT("Performing %d edits...\n"), trials); - wxGetApp().Yield(); + wxTheApp->Yield(); FlushPrint(); timer.Start(); @@ -454,7 +454,7 @@ void BenchmarkDialog::OnRun( wxCommandEvent &event ) } Printf(wxT("Time to perform %d edits: %ld ms\n"), trials, elapsed); FlushPrint(); - wxGetApp().Yield(); + wxTheApp->Yield(); #if 0 @@ -466,7 +466,7 @@ void BenchmarkDialog::OnRun( wxCommandEvent &event ) Printf(wxT("Doing correctness check...\n")); FlushPrint(); - wxGetApp().Yield(); + wxTheApp->Yield(); bad = 0; timer.Start(); @@ -491,7 +491,7 @@ void BenchmarkDialog::OnRun( wxCommandEvent &event ) Printf(wxT("Time to check all data: %ld ms\n"), elapsed); Printf(wxT("Reading data again...\n")); - wxGetApp().Yield(); + wxTheApp->Yield(); FlushPrint(); timer.Start(); diff --git a/src/CaptureEvents.cpp b/src/CaptureEvents.cpp index fd998b000..78755787a 100644 --- a/src/CaptureEvents.cpp +++ b/src/CaptureEvents.cpp @@ -68,7 +68,7 @@ static void main_do_event(GdkEvent *event, wxArrayPtrVoid *queue) CaptureEvents::CaptureEvents() { #if wxUSE_LOG - // disable log flushing from here because a call to wxGetApp().Yield() shouldn't + // disable log flushing from here because a call to wxTheApp->Yield() shouldn't // normally result in message boxes popping up &c wxLog::Suspend(); #endif diff --git a/src/export/ExportCL.cpp b/src/export/ExportCL.cpp index 807035246..a01773bfe 100644 --- a/src/export/ExportCL.cpp +++ b/src/export/ExportCL.cpp @@ -413,7 +413,7 @@ int ExportCL::Export(AudacityProject *project, // Wait for process to terminate while (p->IsActive()) { wxMilliSleep(10); - wxGetApp().Yield(); + wxTheApp->Yield(); } // Display output on error or if the user wants to see it