Dylib destructor not called

I have dylib that I can download via injection on mac os x. The design challenge works well.

 __attribute__((constructor))
 static void initialize()

But the destructor is not called? In this way, resources initiate leaks.

__attribute__((destructor))
static void destroy()
  • Does dylib remove automatically if the application shuts down?
  • Is dylib injection injected automatically when the application loads?
  • How can we unload dylib from an application at runtime? As an injection code, I can access a private area. Is there a team for this?
+5
source share
1 answer

1, 2: . - , , (, , , ..) .

3: , . , - dlopen(), , , , dlclose(); NSBundle - .

, . , , ObjC, .

+4

All Articles