[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sc-devel] Problem with UI.shutdown order



or as an alternative, remove the UI->shutdown registration from NetAddr, and modify Process:shutdown

current:
	shutdown {
		// This method is called before recompiling or quitting.
		// Override in class 'Main' to do whatever you want.
		UI.shutdown;
		//OSCPort.closeAll;
		File.closeAll;
		Archive.write;
	}

new:
	shutdown {
		// This method is called before recompiling or quitting.
		// Override in class 'Main' to do whatever you want.
		UI.shutdown;
		NetAddr.disconnectAll;
		File.closeAll;
		Archive.write;
	}

maybe this idea is better?

ciao, -sciss-




Am 06.02.2008 um 23:16 schrieb Sciss:

i would like to propose the following modification of
UI:*registerForShutdown:

current:
	*registerForShutdown {
		arg function;
		shutdownActions = shutdownActions.add(function);
	}

new:
	*registerForShutdown { arg function, addAction = \addToTail;
		switch( addAction,
		\addToTail, { shutdownActions = shutdownActions.add( function )},
\addToHead, { shutdownActions = function.asArray ++ shutdownActions }, { Error( "Illegal addAction " ++ addAction.asCompileString ).throw });
	}

because that would allow me (you) to register something that is
executed before other regular shutdown procedures, e.g.
JSCWindow.closeAll before NetAddr.disconnectAll.

since it doesn't break anything, there shouldn't be problem to commit
that?

ciao, -sciss-


Am 06.02.2008 um 09:39 schrieb Sciss:

hi,

i have a severe problem with the latest RC: there is a race condition
in UI -> shutdown : what never happened before in three years is that
NetAddr's

		UI.registerForShutdown({
			this.disconnectAll;
		});

is executed before JSCWindow's

		UI.registerForShutdown({ this.closeAll });

.... that means that the windows cannot be closed any more (the TCP
connection is cut before JSCWindow.closeAll is called) ...

that is obviously very bad and i don't know how to solve that
problem. has the class initialization order been changed in some way?
can NetAddr's disconnectAll be executed after the shutdown
registrations?

ciao, -sciss-
_______________________________________________
Sc-devel mailing list
Sc-devel@xxxxxxxxxxxxxxx
http://lists.create.ucsb.edu/mailman/listinfo/sc-devel

_______________________________________________
Sc-devel mailing list
Sc-devel@xxxxxxxxxxxxxxx
http://lists.create.ucsb.edu/mailman/listinfo/sc-devel