Index: runtime/vm/virtual_memory_win.cc |
diff --git a/runtime/vm/virtual_memory_win.cc b/runtime/vm/virtual_memory_win.cc |
index 100041766bcf5753e33407475c70592e63312f4a..dd154ac1c0fbdcaa0982ac82d5e4248f31a4ac21 100644 |
--- a/runtime/vm/virtual_memory_win.cc |
+++ b/runtime/vm/virtual_memory_win.cc |
@@ -33,7 +33,7 @@ VirtualMemory* VirtualMemory::ReserveInternal(intptr_t size) { |
VirtualMemory::~VirtualMemory() { |
- if (reserved_size_ == 0) { |
+ if (embedder_allocated() || (reserved_size_ == 0)) { |
return; |
} |
if (VirtualFree(address(), 0, MEM_RELEASE) == 0) { |