Przeglądaj źródła

dynlib: fix initialize_symbols when there is no field for the handle in the struct

Laytan Laats 6 miesięcy temu
rodzic
commit
189b4782fb
1 zmienionych plików z 5 dodań i 0 usunięć
  1. 5 0
      core/dynlib/lib.odin

+ 5 - 0
core/dynlib/lib.odin

@@ -145,6 +145,11 @@ initialize_symbols :: proc(
 		}
 	}
 
+	// No field for it in the struct.
+	if handle == nil {
+		handle = load_library(library_path) or_return
+	}
+
 	// Buffer to concatenate the prefix + symbol name.
 	prefixed_symbol_buf: [2048]u8 = ---