Index: third_party/WebKit/LayoutTests/storage/indexeddb/cursor-leak.html |
diff --git a/third_party/WebKit/LayoutTests/storage/indexeddb/cursor-leak.html b/third_party/WebKit/LayoutTests/storage/indexeddb/cursor-leak.html |
index abeabf87944aeb4aa06633e6a0daa942e93df0d3..6fbda670510d9e452212b566256119c293bd8e87 100644 |
--- a/third_party/WebKit/LayoutTests/storage/indexeddb/cursor-leak.html |
+++ b/third_party/WebKit/LayoutTests/storage/indexeddb/cursor-leak.html |
@@ -40,7 +40,11 @@ function onOpen(evt) |
cursor.primaryKey.cursor = cursor; |
cursor.value.cursor = cursor; |
- cursorObserver = internals.observeGC(cursor); |
+ // Do not pass the object directly to observeGC function. This may |
+ // remain live on this function's stack preventing GC from collecting |
+ // it. Accessing the object inside an inner function will prevent any |
+ // unneeded references on this function's stack. |
+ cursorObserver = internals.observeGC((() => {return cursor;})()); |
cursorRequest = null; |
cursor = null; |