From eabc3b10b8bd17c4ab01829eb711a7547c97fba9 Mon Sep 17 00:00:00 2001 From: Esteban Lorenzano Date: Fri, 26 Jan 2024 13:00:16 +0100 Subject: [PATCH] clean up --- .../SpMorphicBoxAdapter.class.st | 15 ++++++++------- src/Spec2-Layout/SpExecutableLayout.class.st | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/Spec2-Adapters-Morphic/SpMorphicBoxAdapter.class.st b/src/Spec2-Adapters-Morphic/SpMorphicBoxAdapter.class.st index 2bd8db7e..2dbfd83e 100644 --- a/src/Spec2-Adapters-Morphic/SpMorphicBoxAdapter.class.st +++ b/src/Spec2-Adapters-Morphic/SpMorphicBoxAdapter.class.st @@ -247,14 +247,15 @@ SpMorphicBoxAdapter >> newWrapMorph [ { #category : 'accessing' } SpMorphicBoxAdapter >> remove: aPresenter [ + | morph adapter | - aPresenter adapter ifNotNil: [ :adapter | - | morph | - adapter unsubscribe. - morph := adapter widget. - startPanel removeMorph: morph. - endPanel removeMorph: morph. - self verifyBoxExtent ] + (adapter := aPresenter adapter) ifNil: [ ^ self ]. + + adapter unsubscribe. + morph := adapter widget. + startPanel removeMorph: morph. + endPanel removeMorph: morph. + self verifyBoxExtent ] { #category : 'accessing' } diff --git a/src/Spec2-Layout/SpExecutableLayout.class.st b/src/Spec2-Layout/SpExecutableLayout.class.st index f7f9b514..b5c4adaa 100644 --- a/src/Spec2-Layout/SpExecutableLayout.class.st +++ b/src/Spec2-Layout/SpExecutableLayout.class.st @@ -340,7 +340,7 @@ SpExecutableLayout >> unsubscribe [ { #category : 'events' } SpExecutableLayout >> whenChildrenAddedDo: aBlock [ - self announcer weak + self announcer when: SpChildrenAdded do: aBlock for: aBlock receiver @@ -349,7 +349,7 @@ SpExecutableLayout >> whenChildrenAddedDo: aBlock [ { #category : 'events' } SpExecutableLayout >> whenChildrenRemovedDo: aBlock [ - self announcer weak + self announcer when: SpChildrenRemoved do: aBlock for: aBlock receiver