mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-05-13 03:16:17 +02:00
fix: macos, load multi dylib instances (#8731)
Multiple dylib instances will cause some global instances to be invalid. eg. lazy_static objects in rust side, will be created more than once. Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
parent
a4565bf0da
commit
901505e8be
1 changed files with 7 additions and 3 deletions
|
@ -117,9 +117,13 @@ class PlatformFFI {
|
|||
? DynamicLibrary.open('librustdesk.so')
|
||||
: isWindows
|
||||
? DynamicLibrary.open('librustdesk.dll')
|
||||
: isMacOS
|
||||
? DynamicLibrary.open("liblibrustdesk.dylib")
|
||||
: DynamicLibrary.process();
|
||||
:
|
||||
// Use executable itself as the dynamic library for MacOS.
|
||||
// Multiple dylib instances will cause some global instances to be invalid.
|
||||
// eg. `lazy_static` objects in rust side, will be created more than once, which is not expected.
|
||||
//
|
||||
// isMacOS? DynamicLibrary.open("liblibrustdesk.dylib") :
|
||||
DynamicLibrary.process();
|
||||
debugPrint('initializing FFI $_appType');
|
||||
try {
|
||||
_session_get_rgba = dylib.lookupFunction<F3Dart, F3>("session_get_rgba");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue