Use a thread for dispatch events

This commit is contained in:
Robbert van der Helm
2020-03-05 16:29:59 +01:00
parent 6c4dca151b
commit 814a3b40b5
6 changed files with 45 additions and 37 deletions
+3 -3
View File
@@ -33,10 +33,10 @@ int main(int argc, char* argv[]) {
const std::string socket_endpoint_path(argv[2]);
try {
PluginBridge Pluginbridge(plugin_dll_path, socket_endpoint_path);
PluginBridge bridge(plugin_dll_path, socket_endpoint_path);
// TODO: Remove debug
Pluginbridge.dispatch_loop();
// Block the main thread until the plugin shuts down
bridge.wait();
} catch (const std::runtime_error& error) {
std::cerr << "Error while initializing plugin:" << std::endl;
std::cerr << error.what() << std::endl;