Browse Source

Do not show error message box on Windows during discovery

Signed-off-by: falkTX <falktx@falktx.com>
pull/1658/merge
falkTX 6 months ago
parent
commit
1f6bcd0aa6
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
1 changed files with 18 additions and 1 deletions
  1. +18
    -1
      source/discovery/carla-discovery.cpp

+ 18
- 1
source/discovery/carla-discovery.cpp View File

@@ -129,7 +129,8 @@ public:

~DiscoveryPipe()
{
jackbridge_discovery_pipe_destroy(pipe);
if (pipe != nullptr)
jackbridge_discovery_pipe_destroy(pipe);
}

bool initPipeClient(const char* argv[])
@@ -171,6 +172,16 @@ static void print_lib_error(const char* const filename)
}
}

#ifdef CARLA_OS_WIN
// --------------------------------------------------------------------------------------------------------------------
// Do not show error message box on Windows

static LONG win32ExceptionFilter(_EXCEPTION_POINTERS*)
{
return EXCEPTION_EXECUTE_HANDLER;
}
#endif

// --------------------------------------------------------------------------------------------------------------------
// Carla Cached API

@@ -2804,13 +2815,19 @@ int main(int argc, const char* argv[])
#endif

#ifdef CARLA_OS_WIN
// init win32 stuff that plugins might use
OleInitialize(nullptr);
CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);

#ifndef __WINPTHREADS_VERSION
// (non-portable) initialization of statically linked pthread library
pthread_win32_process_attach_np();
pthread_win32_thread_attach_np();
#endif

// do not show error message box on Windows
SetErrorMode(SEM_NOGPFAULTERRORBOX);
SetUnhandledExceptionFilter(win32ExceptionFilter);
#endif

// ----------------------------------------------------------------------------------------------------------------


Loading…
Cancel
Save