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

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



since noone complained and the fix should not interfere with any other code, i have committed this fix now. (rev. 7286).

ciao, -sciss-

Am 07.02.2008 um 16:58 schrieb Sciss:

that would be

Index: build/SCClassLibrary/Common/Control/NetAddr.sc
===================================================================
--- build/SCClassLibrary/Common/Control/NetAddr.sc (revision 7266)
+++ build/SCClassLibrary/Common/Control/NetAddr.sc      (working copy)
@@ -5,9 +5,6 @@

         *initClass {
                 connections = IdentityDictionary.new;
-               UI.registerForShutdown({
-                       this.disconnectAll;
-               });
         }

         *new { arg hostname, port=0;
Index: build/SCClassLibrary/Common/Core/Kernel.sc
===================================================================
--- build/SCClassLibrary/Common/Core/Kernel.sc  (revision 7266)
+++ build/SCClassLibrary/Common/Core/Kernel.sc  (working copy)
@@ -198,7 +198,7 @@
                 // This method is called before recompiling or
quitting.
                 // Override in class 'Main' to do whatever you want.
                 UI.shutdown;
-               //OSCPort.closeAll;
+               NetAddr.disconnectAll;
                 File.closeAll;
                 Archive.write;
         }


i tested it and it works as expected.


Am 07.02.2008 um 12:49 schrieb ronald kuivila:

Hi sciss,

I prefer this solution.
It seems to me that UI belongs in Process as it is part of the
basic user/programming environment.

RJK

On Feb 6, 2008, at 5:21 PM, Sciss wrote:

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

_______________________________________________
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

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