mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-31 16:09:28 +02:00
From: martin@steghoefer.eu [PATCH 16/16] Fix runtime problem with wxWidgets 3.0: Segmentation fault due to events arriving before initialization.
"The dialogs LadspaEffectDialog, LV2EffectDialog and VampEffectDialog receive EVT_TEXT events before the dialog classes are properly initialized. To prevent this, a workaround was already in place, but was only active on Windows. This happens now on more platforms (including GTK). So activate it on the wxGTK with wx3.0, too."
This commit is contained in:
parent
88ed83d967
commit
af8457dd1c
@ -41,6 +41,7 @@ effects from this one class.
|
||||
#include <wx/tokenzr.h>
|
||||
#include <wx/intl.h>
|
||||
#include <wx/scrolwin.h>
|
||||
#include <wx/version.h>
|
||||
|
||||
#include "../Effect.h" // Audacity Effect base class
|
||||
#include "LadspaEffect.h" // This class's header file
|
||||
@ -1116,10 +1117,10 @@ LadspaEffectDialog::LadspaEffectDialog(LadspaEffect *eff,
|
||||
mData = data;
|
||||
mInputControls = inputControls;
|
||||
mSampleRate = sampleRate;
|
||||
#ifdef __WXMSW__
|
||||
// On Windows, for some reason, wxWidgets calls OnTextCtrl during creation
|
||||
#if defined(__WXMSW__) || (defined(__WXGTK__) && wxCHECK_VERSION(3, 0, 0))
|
||||
// In some environments wxWidgets calls OnTextCtrl during creation
|
||||
// of the text control, and LadspaEffectDialog::OnTextCtrl calls HandleText,
|
||||
// which assumes all the mFields have been initialized.
|
||||
// which assumes all the fields have been initialized.
|
||||
// This can give us a bad pointer crash, so manipulate inSlider to
|
||||
// no-op HandleText during creation.
|
||||
inSlider = true;
|
||||
|
@ -40,6 +40,7 @@
|
||||
#include <wx/tokenzr.h>
|
||||
#include <wx/intl.h>
|
||||
#include <wx/scrolwin.h>
|
||||
#include <wx/version.h>
|
||||
|
||||
#include "../Effect.h"
|
||||
#include "LoadLV2.h"
|
||||
@ -913,10 +914,10 @@ LV2EffectDialog::LV2EffectDialog(LV2Effect *effect,
|
||||
mLength(length)
|
||||
{
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
// On Windows, for some reason, wxWindows calls OnTextCtrl during creation
|
||||
#if defined(__WXMSW__) || (defined(__WXGTK__) && wxCHECK_VERSION(3, 0, 0))
|
||||
// In some environments wxWindows calls OnTextCtrl during creation
|
||||
// of the text control, and LV2EffectDialog::OnTextCtrl calls HandleText,
|
||||
// which assumes all the mFields have been initialized.
|
||||
// which assumes all the fields have been initialized.
|
||||
// This can give us a bad pointer crash, so manipulate inSlider to
|
||||
// no-op HandleText during creation.
|
||||
inSlider = true;
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include <wx/tokenzr.h>
|
||||
#include <wx/intl.h>
|
||||
#include <wx/scrolwin.h>
|
||||
#include <wx/version.h>
|
||||
|
||||
VampEffect::VampEffect(Vamp::HostExt::PluginLoader::PluginKey key,
|
||||
int output,
|
||||
@ -333,8 +334,8 @@ VampEffectDialog::VampEffectDialog(VampEffect *effect,
|
||||
|
||||
mParameters = plugin->getParameterDescriptors();
|
||||
|
||||
#ifdef __WXMSW__
|
||||
// On Windows, for some reason, wxWidgets calls OnTextCtrl during creation
|
||||
#if defined(__WXMSW__) || (defined(__WXGTK__) && wxCHECK_VERSION(3, 0, 0))
|
||||
// In some environments wxWidgets calls OnTextCtrl during creation
|
||||
// of the text control, and VampEffectDialog::OnTextCtrl calls HandleText,
|
||||
// which assumes all the fields have been initialized.
|
||||
// This can give us a bad pointer crash, so manipulate inSlider to
|
||||
|
Loading…
x
Reference in New Issue
Block a user