mirror of
https://github.com/rubyjs/mini_racer
synced 2023-03-27 23:21:28 -04:00
FIX: don't try to release forked isolates, just leak them
This commit is contained in:
parent
c41db24eb1
commit
26e8584a21
3 changed files with 15 additions and 3 deletions
|
@ -1,3 +1,9 @@
|
|||
02-11-2016
|
||||
|
||||
- 0.1.7
|
||||
|
||||
- Fix: if for some reason an isolate was forked don't free it and raise a warning instead to avoid hanging process
|
||||
|
||||
25-10-2016
|
||||
|
||||
- 0.1.6
|
||||
|
|
|
@ -30,6 +30,7 @@ typedef struct {
|
|||
ArrayBufferAllocator* allocator;
|
||||
StartupData* startup_data;
|
||||
bool interrupted;
|
||||
pid_t pid;
|
||||
|
||||
// how many references to this isolate exist
|
||||
// we can't rely on Ruby's GC for this, because when destroying
|
||||
|
@ -763,10 +764,14 @@ void maybe_free_isolate_info(IsolateInfo* isolate_info) {
|
|||
|
||||
if (isolate_info->isolate) {
|
||||
if (isolate_info->interrupted) {
|
||||
fprintf(stderr, "WARNING: V8 isolate was interrupted by Ruby, it can not be disposed and memory will not be reclaimed till the Ruby process exits.");
|
||||
fprintf(stderr, "WARNING: V8 isolate was interrupted by Ruby, it can not be disposed and memory will not be reclaimed till the Ruby process exits.\n");
|
||||
} else {
|
||||
|
||||
isolate_info->isolate->Dispose();
|
||||
if (isolate_info->pid != getpid()) {
|
||||
fprintf(stderr, "WARNING: V8 isolate was forked, it can not be disposed and memory will not be reclaimed till the Ruby process exits.\n");
|
||||
} else {
|
||||
isolate_info->isolate->Dispose();
|
||||
}
|
||||
}
|
||||
isolate_info->isolate = NULL;
|
||||
}
|
||||
|
@ -846,6 +851,7 @@ VALUE allocate_isolate(VALUE klass) {
|
|||
isolate_info->startup_data = NULL;
|
||||
isolate_info->interrupted = false;
|
||||
isolate_info->refs_count = 0;
|
||||
isolate_info->pid = getpid();
|
||||
|
||||
return Data_Wrap_Struct(klass, NULL, deallocate_isolate, (void*)isolate_info);
|
||||
}
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
module MiniRacer
|
||||
VERSION = "0.1.6"
|
||||
VERSION = "0.1.7"
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue