Skip to content

Commit 4367500

Browse files
CommonAPI 3.1.10.1
1 parent a4c5fed commit 4367500

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

CHANGES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
Changes
22
=======
33

4+
v3.1.10.1
5+
- Fixed crash on dlclose()
6+
47
v3.1.10
58
- no changes
69

include/CommonAPI/Types.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,21 @@ namespace CommonAPI {
5353
static void __cdecl f(void); \
5454
__declspec(allocate(".CRT$XCU")) void(__cdecl*f##_)(void) = f; \
5555
static void __cdecl f(void)
56+
#define DEINITIALIZER(f) \
57+
static void __cdecl f(void); \
58+
static void _##f##_wrapper(void) { \
59+
atexit(f); \
60+
} \
61+
__declspec(allocate(".CRT$XCU")) void(__cdecl * f##_)(void) = _##f##_wrapper; \
62+
static void __cdecl f(void)
5663
#else
5764
#define CCALL
5865
#define INITIALIZER(f) \
5966
static void f(void) __attribute__((constructor)); \
6067
static void f(void)
68+
#define DEINITIALIZER(f) \
69+
static void f(void) __attribute__((destructor)); \
70+
static void f(void)
6171
#endif
6272

6373
namespace CommonAPI {

0 commit comments

Comments
 (0)