summaryrefslogtreecommitdiff
path: root/libs/fst/vstwin.c
diff options
context:
space:
mode:
Diffstat (limited to 'libs/fst/vstwin.c')
-rw-r--r--libs/fst/vstwin.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/libs/fst/vstwin.c b/libs/fst/vstwin.c
index 8911ff4a01..55061c2b72 100644
--- a/libs/fst/vstwin.c
+++ b/libs/fst/vstwin.c
@@ -326,9 +326,17 @@ DWORD WINAPI gui_event_loop (LPVOID param)
fst_error ("cannot set timer on dummy window");
}
- while (GetMessageA (&msg, NULL, 0,0)) {
+ while (1) {
+
+ GetMessageA (&msg, NULL, 0,0);
+
+ if (msg.message == WM_SYSTEMERROR) {
+ /* sent when this thread is supposed to exist */
+ break;
+ }
- if( msg.message == WM_KEYDOWN ) debreak();
+ if (msg.message == WM_KEYDOWN) debreak();
+
TranslateMessage( &msg );
DispatchMessageA (&msg);
@@ -336,7 +344,6 @@ DWORD WINAPI gui_event_loop (LPVOID param)
and run idle callbacks
*/
-
if( msg.message == WM_TIMER ) {
pthread_mutex_lock (&plugin_mutex);
again:
@@ -411,6 +418,12 @@ fst_init ()
return 0;
}
+void
+fst_finish ()
+{
+ PostThreadMessageA (gui_thread_id, WM_SYSTEMERROR, 0, 0);
+}
+
int
fst_run_editor (FST* fst)
{
@@ -501,7 +514,9 @@ fst_load (const char *path)
return NULL;
}
- if ((fhandle->main_entry = GetProcAddress (fhandle->dll, "main")) == NULL) {
+ typedef AEffect* (*entryFunctionType)(audioMasterCallback);
+
+ if ((fhandle->main_entry = (entryFunctionType) GetProcAddress (fhandle->dll, "main")) == NULL) {
fst_unload (fhandle);
return NULL;
}