Avoid crash with GTK3 if console program is linked to GUI library
A console program should not really be linked with the GUI library, but it used to work, and it's unavoidable with the monolithic build, so fix the regression. See #23981
This commit is contained in:
parent
7fbe3698c5
commit
4cabfa111a
1 changed files with 5 additions and 0 deletions
|
|
@ -13,6 +13,7 @@
|
|||
#include "wx/settings.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/app.h"
|
||||
#include "wx/toplevel.h"
|
||||
#include "wx/module.h"
|
||||
#endif
|
||||
|
|
@ -1206,6 +1207,10 @@ bool wxSystemSettingsModule::OnInit()
|
|||
|
||||
m_proxy = nullptr;
|
||||
|
||||
wxAppConsole* app = wxAppConsole::GetInstance();
|
||||
if (!app || !app->IsGUI())
|
||||
return true;
|
||||
|
||||
// GTK_THEME environment variable overrides other settings
|
||||
if (getenv("GTK_THEME") == nullptr)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue