File tree 7 files changed +13
-1
lines changed
7 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -33,4 +33,3 @@ credits
33
33
todo
34
34
- add stop timer flag to stop the timer thread
35
35
- wclose should signal instead of just setting the variable
36
- - implement lneedsreload in lib.c
Original file line number Diff line number Diff line change @@ -23,6 +23,11 @@ enum lstatus lload(struct lib *lib)
23
23
return luptodate ;
24
24
25
25
if (lib -> handle ) {
26
+ if (!lib -> reload_on_next_call ) {
27
+ lib -> reload_on_next_call = 1 ;
28
+ return lneedsreload ;
29
+ }
30
+
26
31
result = lreloaded ;
27
32
FreeLibrary (lib -> handle );
28
33
lib -> handle = 0 ;
@@ -42,6 +47,7 @@ enum lstatus lload(struct lib *lib)
42
47
return lfailed ;
43
48
44
49
lib -> loaded_time = fattr .ftLastWriteTime ;
50
+ lib -> reload_on_next_call = 0 ;
45
51
46
52
return result ;
47
53
#endif
@@ -57,6 +63,11 @@ enum lstatus lload(struct lib *lib)
57
63
return luptodate ;
58
64
59
65
if (lib -> handle ) {
66
+ if (!lib -> reload_on_next_call ) {
67
+ lib -> reload_on_next_call = 1 ;
68
+ return lneedsreload ;
69
+ }
70
+
60
71
result = lreloaded ;
61
72
dlclose (lib -> handle );
62
73
lib -> handle = 0 ;
@@ -67,6 +78,7 @@ enum lstatus lload(struct lib *lib)
67
78
return lfailed ;
68
79
69
80
lib -> loaded_time = fattr .st_mtime ;
81
+ lib -> reload_on_next_call = 0 ;
70
82
71
83
return result ;
72
84
#endif
Original file line number Diff line number Diff line change 9
9
struct lib {
10
10
void * handle ;
11
11
const char * path ;
12
+ int reload_on_next_call ;
12
13
13
14
#ifdef _WIN32
14
15
char copy_path [256 ];
You can’t perform that action at this time.
0 commit comments