Skip to content

Commit d1def16

Browse files
revert(@glimmer/destroyable): revert metadata clearing - root cause is elsewhere
Co-authored-by: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
1 parent 12ebfa7 commit d1def16

2 files changed

Lines changed: 0 additions & 24 deletions

File tree

packages/@glimmer/destroyable/index.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,6 @@ export function destroy(destroyable: Destroyable) {
183183
});
184184

185185
meta.state = DESTROYED_STATE;
186-
187-
// Release references so GC can reclaim the destroyed tree
188-
meta.parents = null;
189-
meta.children = null;
190-
meta.eagerDestructors = null;
191-
meta.destructors = null;
192186
});
193187
}
194188

packages/@glimmer/destroyable/test/destroyables-test.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { DEBUG } from '@glimmer/env';
22
import type { GlobalContext } from '@glimmer/global-context';
33
import { unwrap } from '@glimmer/debug-util';
44
import {
5-
_hasDestroyableChildren,
65
assertDestroyablesDestroyed,
76
associateDestroyableChild,
87
destroy,
@@ -385,23 +384,6 @@ module('Destroyables', (hooks) => {
385384
assert.verifySteps(['child destructor', 'parent destructor'], 'destructors run bottom up');
386385
});
387386

388-
test('metadata children reference is cleared after destruction completes', (assert) => {
389-
const parent = {};
390-
const child = {};
391-
392-
associateDestroyableChild(parent, child);
393-
394-
assert.true(_hasDestroyableChildren(parent), 'parent has children before destruction');
395-
396-
destroy(parent);
397-
flush();
398-
399-
assert.false(
400-
_hasDestroyableChildren(parent),
401-
'parent metadata clears children reference after destruction, allowing GC to reclaim the tree'
402-
);
403-
});
404-
405387
if (DEBUG) {
406388
test('attempting to unregister a destructor that was not registered throws an error', (assert) => {
407389
assert.throws(() => {

0 commit comments

Comments
 (0)