Ok, here's the fix. This solves all but a few of the similar errors at patch closing (e.g. open the same pd patch-> open subpatch-> close subpatch-> close main patch-> get 2 errors invalid command name ".<window_name>.c".). This remaining bug does not happen if you close the entire patch with both windows open.
At any rate, the other fix is attached.
ico