﻿'From Squeak6.0alpha of 11 May 2022 [latest update: #21739] on 21 May 2022 at 11:08:58 am'!

!Debugger methodsFor: 'context stack menu' stamp: 'jar 5/21/2022 11:03'!
abandon
	"abandon the debugger from its pre-debug notifier"
	
	self close: #terminateAggressively.! !

!Debugger methodsFor: 'context stack menu' stamp: 'jar 5/21/2022 11:03'!
terminateProcess

	self close: #terminate.! !

!Debugger methodsFor: 'initialize' stamp: 'jar 5/21/2022 11:04'!
close: aSymbol
	"Close and delete this debugger. Try to trigger the close request through the UI first, do manually of not in the UI."

	self flag: #refactor. "mt: Maybe move this up to model?"
	self topView
		ifNotNil: [self changed: #close]
		ifNil: [
			self okToClose ifTrue: [
				self windowIsClosing: aSymbol; release]].! !

!Debugger methodsFor: 'initialize' stamp: 'jar 5/21/2022 11:05'!
windowIsClosing: aSymbol
	"My window is being closed; clean up. Restart the low space watcher."

	contextStack := nil.
	receiverInspector := nil.
	contextVariablesInspector := nil.
	
	interruptedProcess == nil ifTrue: [^ self].
	interruptedProcess perform: aSymbol.
	interruptedProcess := nil.
	
	Smalltalk installLowSpaceWatcher.  "restart low space handler"! !

