FIX: ensure output is flushed when producing heap dumps

This commit is contained in:
Sam Saffron 2020-05-14 17:13:24 +10:00
parent 2b1ee800ff
commit edc8919aaa
No known key found for this signature in database
GPG Key ID: B9606168D2FFD9F5
1 changed files with 2 additions and 0 deletions

View File

@ -1421,6 +1421,8 @@ rb_heap_snapshot(VALUE self, VALUE file) {
FileOutputStream stream(fp);
snap->Serialize(&stream, HeapSnapshot::kJSON);
fflush(fp);
const_cast<HeapSnapshot*>(snap)->Delete();
return Qtrue;