Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2972)

Unified Diff: runtime/vm/dart_api_impl_test.cc

Issue 15070014: - Create a local scope so that the GC can collect the external (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl_test.cc
===================================================================
--- runtime/vm/dart_api_impl_test.cc (revision 22757)
+++ runtime/vm/dart_api_impl_test.cc (working copy)
@@ -1379,12 +1379,15 @@
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
- obj = Dart_NewExternalTypedData(kFloat32x4,
- data,
- 10,
- &peer,
- ExternalTypedDataCallbackFinalizer);
- CheckFloat32x4Data(obj);
+ // Push a scope so that we can collect the local handle created as part of
+ // Dart_NewExternalTypedData.
+ Dart_EnterScope();
+ {
+ Dart_Handle lcl = Dart_NewExternalTypedData(
+ kFloat32x4, data, 10, &peer, ExternalTypedDataCallbackFinalizer);
+ CheckFloat32x4Data(lcl);
+ }
+ Dart_ExitScope();
Isolate::Current()->heap()->CollectGarbage(Heap::kNew);
EXPECT(peer == 42);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698