mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-07-19 23:16:48 +00:00
correctly close module file handles on module unloading in new demon layer
This commit is contained in:
+1
-2
@@ -365,8 +365,7 @@ dbgi_binary_close(String8 exe_path)
|
||||
if(need_deletion) for(;;)
|
||||
{
|
||||
os_rw_mutex_drop_w(stripe->rw_mutex);
|
||||
for(U64 start_t = os_now_microseconds();
|
||||
os_now_microseconds() <= start_t + 250;);
|
||||
for(U64 start_t = os_now_microseconds(); os_now_microseconds() <= start_t + 250;);
|
||||
os_rw_mutex_take_w(stripe->rw_mutex);
|
||||
if(binary->refcount == 0 && ins_atomic_u64_eval(&binary->scope_touch_count) == 0)
|
||||
{
|
||||
|
||||
@@ -151,6 +151,10 @@ dmn_w32_entity_release(DMN_W32_Entity *entity)
|
||||
// rjf: free entity
|
||||
SLLStackPush(dmn_w32_shared->entities_first_free, t->e);
|
||||
t->e->gen += 1;
|
||||
if(t->e->kind == DMN_W32_EntityKind_Module)
|
||||
{
|
||||
CloseHandle(t->e->handle);
|
||||
}
|
||||
|
||||
// rjf: remove from id -> entity map
|
||||
if(t->e->id != 0)
|
||||
|
||||
@@ -678,7 +678,8 @@ os_file_close(OS_Handle file)
|
||||
{
|
||||
if(os_handle_match(file, os_handle_zero())) { return; }
|
||||
HANDLE handle = (HANDLE)file.u64[0];
|
||||
CloseHandle(handle);
|
||||
BOOL result = CloseHandle(handle);
|
||||
(void)result;
|
||||
}
|
||||
|
||||
internal U64
|
||||
@@ -896,7 +897,8 @@ internal void
|
||||
os_file_map_close(OS_Handle map)
|
||||
{
|
||||
HANDLE handle = (HANDLE)map.u64[0];
|
||||
CloseHandle(handle);
|
||||
BOOL result = CloseHandle(handle);
|
||||
(void)result;
|
||||
}
|
||||
|
||||
internal void *
|
||||
@@ -939,7 +941,8 @@ os_file_map_view_open(OS_Handle map, OS_AccessFlags flags, Rng1U64 range)
|
||||
internal void
|
||||
os_file_map_view_close(OS_Handle map, void *ptr)
|
||||
{
|
||||
UnmapViewOfFile(ptr);
|
||||
BOOL result = UnmapViewOfFile(ptr);
|
||||
(void)result;
|
||||
}
|
||||
|
||||
//- rjf: directory iteration
|
||||
|
||||
Reference in New Issue
Block a user