do not free MemoryRegion in memory_unmap() because it will be unref later in memory_region_unref(). this fixes issue #202

This commit is contained in:
Nguyen Anh Quynh
2015-10-28 01:26:59 +08:00
parent 3a36e327ab
commit b66a323b19
3 changed files with 4 additions and 3 deletions

View File

@@ -49,6 +49,7 @@ void memory_unmap(struct uc_struct *uc, MemoryRegion *mr)
{
int i;
target_ulong addr;
// Make sure all pages associated with the MemoryRegion are flushed
// Only need to do this if we are in a running state
if (uc->current_cpu) {
@@ -67,8 +68,6 @@ void memory_unmap(struct uc_struct *uc, MemoryRegion *mr)
break;
}
}
g_free(mr);
}
int memory_free(struct uc_struct *uc)