Browse Source

libobs: Separate crash handler from startup

Zachary Lund 7 years ago
parent
commit
121035346f
3 changed files with 13 additions and 2 deletions
  1. 7 0
      libobs/obs-windows.c
  2. 0 2
      libobs/obs.c
  3. 6 0
      libobs/obs.h

+ 7 - 0
libobs/obs-windows.c

@@ -788,6 +788,13 @@ void reset_win32_symbol_paths(void)
 	da_free(paths);
 }
 
+extern void initialize_crash_handler(void);
+
+void obs_init_win32_crash_handler(void)
+{
+	initialize_crash_handler();
+}
+
 void initialize_com(void)
 {
 	CoInitializeEx(0, COINIT_MULTITHREADED);

+ 0 - 2
libobs/obs.c

@@ -776,7 +776,6 @@ static bool obs_init(const char *locale, const char *module_config_path,
 }
 
 #ifdef _WIN32
-extern void initialize_crash_handler(void);
 extern void initialize_com(void);
 extern void uninitialize_com(void);
 #endif
@@ -795,7 +794,6 @@ bool obs_startup(const char *locale, const char *module_config_path,
 	}
 
 #ifdef _WIN32
-	initialize_crash_handler();
 	initialize_com();
 #endif
 

+ 6 - 0
libobs/obs.h

@@ -276,6 +276,12 @@ EXPORT void obs_set_locale(const char *locale);
 /** @return the current locale */
 EXPORT const char *obs_get_locale(void);
 
+/** Initialize the Windows-specific crash handler */
+
+#ifdef _WIN32
+EXPORT void obs_init_win32_crash_handler(void);
+#endif
+
 /**
  * Returns the profiler name store (see util/profiler.h) used by OBS, which is
  * either a name store passed to obs_startup, an internal name store, or NULL