diff --git a/dlls/jscript/jsutils.c b/dlls/jscript/jsutils.c index 5417daf5d51..73bac94d7e8 100644 --- a/dlls/jscript/jsutils.c +++ b/dlls/jscript/jsutils.c @@ -27,6 +27,7 @@ #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(jscript); +WINE_DECLARE_DEBUG_CHANNEL(heap); const char *debugstr_variant(const VARIANT *v) { @@ -51,6 +52,7 @@ const char *debugstr_variant(const VARIANT *v) } #define MIN_BLOCK_SIZE 128 +#define ARENA_FREE_FILLER 0xaa static inline DWORD block_size(DWORD block) { @@ -139,6 +141,13 @@ void jsheap_clear(jsheap_t *heap) heap_free(tmp); } + if(WARN_ON(heap)) { + DWORD i; + + for(i=0; i < heap->block_cnt; i++) + memset(heap->blocks[i], ARENA_FREE_FILLER, block_size(i)); + } + heap->last_block = heap->offset = 0; heap->mark = FALSE; }