diff --git a/dfhack/DFHackAPI_C.cpp b/dfhack/DFHackAPI_C.cpp index b9ebb76a9..e7bf624b0 100644 --- a/dfhack/DFHackAPI_C.cpp +++ b/dfhack/DFHackAPI_C.cpp @@ -49,11 +49,14 @@ DFHackObject* API_Alloc(const char* path_to_xml) } //FIXME: X:\dfhack\DFHackAPI_C.cpp:56: warning: deleting `DFHackObject* ' is undefined +//DC: Yeah, I forgot that trying to delete a void pointer might be a bad idea. This works now. void API_Free(DFHackObject* api) { if(api != NULL) { - delete api; + DFHack::API* a = (DFHack::API*)api; + delete a; + api = NULL; } }