delete re;
re = next;
}
+ first_extension_ = NULL;
}
void ExternalReference::TearDownMathExpData() {
delete[] math_exp_constants_array;
+ math_exp_constants_array = NULL;
delete[] math_exp_log_table_array;
+ math_exp_log_table_array = NULL;
delete math_exp_data_mutex;
+ math_exp_data_mutex = NULL;
}
void Bootstrapper::TearDownExtensions() {
delete free_buffer_extension_;
+ free_buffer_extension_ = NULL;
delete gc_extension_;
+ gc_extension_ = NULL;
delete externalize_string_extension_;
+ externalize_string_extension_ = NULL;
delete statistics_extension_;
+ statistics_extension_ = NULL;
delete trigger_failure_extension_;
+ trigger_failure_extension_ = NULL;
}
template <InstructionOperand::Kind kOperandKind, int kNumCachedOperands>
void SubKindOperand<kOperandKind, kNumCachedOperands>::TearDownCache() {
delete[] cache;
+ cache = NULL;
}
#undef ELEMENTS_TRAITS
-ElementsAccessor** ElementsAccessor::elements_accessors_;
+ElementsAccessor** ElementsAccessor::elements_accessors_ = NULL;
static bool HasKey(Handle<FixedArray> array, Handle<Object> key_handle) {
void ElementsAccessor::TearDown() {
+ if (elements_accessors_ == NULL) return;
#define ACCESSOR_DELETE(Class, Kind, Store) delete elements_accessors_[Kind];
ELEMENTS_LIST(ACCESSOR_DELETE)
#undef ACCESSOR_DELETE
void Isolate::GlobalTearDown() {
delete thread_data_table_;
+ thread_data_table_ = NULL;
}
template<LOperand::Kind kOperandKind, int kNumCachedOperands>
void LSubKindOperand<kOperandKind, kNumCachedOperands>::TearDownCache() {
delete[] cache;
+ cache = NULL;
}
class SignalHandler : public AllStatic {
public:
static void SetUp() { if (!mutex_) mutex_ = new base::Mutex(); }
- static void TearDown() { delete mutex_; }
+ static void TearDown() { delete mutex_; mutex_ = NULL; }
static void IncreaseSamplerCount() {
base::LockGuard<base::Mutex> lock_guard(mutex_);
ExternalReference::TearDownMathExpData();
RegisteredExtension::UnregisterAll();
Isolate::GlobalTearDown();
-
Sampler::TearDown();
FlagList::ResetAllFlags(); // Frees memory held by string arguments.
}
# BUG(382): Weird test. Can't guarantee that it never times out.
'test-api/ApplyInterruption': [PASS, TIMEOUT],
- # TODO(mstarzinger): Fail gracefully on multiple V8::Dispose calls.
- 'test-api/InitializeAndDisposeOnce': [SKIP],
- 'test-api/InitializeAndDisposeMultiple': [SKIP],
-
# These tests always fail. They are here to test test.py. If
# they don't fail then test.py has failed.
'test-serialize/TestThatAlwaysFails': [FAIL],
// Tests that call v8::V8::Dispose() cannot be threaded.
-TEST(InitializeAndDisposeOnce) {
+UNINITIALIZED_TEST(InitializeAndDisposeOnce) {
CHECK(v8::V8::Initialize());
CHECK(v8::V8::Dispose());
}
// Tests that call v8::V8::Dispose() cannot be threaded.
-TEST(InitializeAndDisposeMultiple) {
+UNINITIALIZED_TEST(InitializeAndDisposeMultiple) {
for (int i = 0; i < 3; ++i) CHECK(v8::V8::Dispose());
for (int i = 0; i < 3; ++i) CHECK(v8::V8::Initialize());
for (int i = 0; i < 3; ++i) CHECK(v8::V8::Dispose());
- // TODO(mstarzinger): This should fail gracefully instead of asserting.
- // for (int i = 0; i < 3; ++i) CHECK(v8::V8::Initialize());
+ for (int i = 0; i < 3; ++i) CHECK(v8::V8::Initialize());
for (int i = 0; i < 3; ++i) CHECK(v8::V8::Dispose());
}