C: fix generation of heap dump

This commit is contained in:
Alexey Andreev 2019-10-07 17:43:18 +03:00
parent 94a96f571b
commit 378111d767

View File

@ -321,7 +321,6 @@ void teavm_gc_defragCompleted() {
}
void teavm_gc_setDumpDirectory(const wchar_t* path) {
#if TEAVM_MEMORY_TRACE
if (teavm_gc_dumpDirectory != NULL) {
free(teavm_gc_dumpDirectory);
}
@ -329,6 +328,5 @@ void teavm_gc_setDumpDirectory(const wchar_t* path) {
size_t bytesLen = sizeof(wchar_t) * (pathLen + 1);
teavm_gc_dumpDirectory = malloc(bytesLen);
memcpy(teavm_gc_dumpDirectory, path, bytesLen);
#endif
}