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