mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-19 19:10:17 +00:00
revert free()
This commit is contained in:
parent
9db90216d1
commit
4d5e6f26d0
@ -156,10 +156,7 @@ __SUCCESS:
|
||||
|
||||
c11_string__delete(filename);
|
||||
c11_string__delete(slashed_path);
|
||||
if(need_free){
|
||||
// data is from `callbacks.importfile` we should use `free()`
|
||||
free((void*)data);
|
||||
}
|
||||
if(need_free) PK_FREE((void*)data);
|
||||
return ok ? 1 : -1;
|
||||
}
|
||||
|
||||
@ -178,7 +175,7 @@ bool py_importlib_reload(py_GlobalRef module) {
|
||||
if(data == NULL) return ImportError("module '%v' not found", path);
|
||||
bool ok = py_exec(data, filename->data, EXEC_MODE, module);
|
||||
c11_string__delete(filename);
|
||||
free(data);
|
||||
PK_FREE(data);
|
||||
py_assign(py_retval(), module);
|
||||
return ok;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user