From 5efb489fc619af95f2f25e7312293cd0ab1b9356 Mon Sep 17 00:00:00 2001 From: Andy Fillebrown Date: Wed, 10 Apr 2019 10:59:58 -0400 Subject: [PATCH] Let native callbacks be defined in shared libraries on *nix platforms. --- src/native/QmlNet/Hosting/CoreHost.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/native/QmlNet/Hosting/CoreHost.cpp b/src/native/QmlNet/Hosting/CoreHost.cpp index 781c4213..41dacd33 100644 --- a/src/native/QmlNet/Hosting/CoreHost.cpp +++ b/src/native/QmlNet/Hosting/CoreHost.cpp @@ -27,7 +27,8 @@ static void* getExportedFunction(const char* symbolName) { FARPROC symbol = GetProcAddress(library, symbolName); return (void*)symbol; #else - void* dll = dlopen(nullptr, RTLD_LAZY); + void* dll = dlopen(nativeModule.isNull() || nativeModule.isEmpty() ? nullptr : nativeModule.toLocal8Bit(), + RTLD_LAZY); void* result = dlsym(dll, symbolName); dlclose(dll); return result;