Gale found that the previous fix for bug #857 didn't
completely address all crashes.
In this case, the sequence of events:
1) Dynamic module is added to list of module using its name, "VST Effects"
2) Language is set (during init) to one that has "VST Effects" translated
3) Language is changed to something else via preferences, which changes
translation of "VST Effects" to something else.
4) During termination, the module is deleted, but since the language
has now changed due to translation, it isn't deleted from the list
of modules
5) An attempt is made to delete the next module, which happens to be
the same one becuase it was never removed from the list.
6) Boom...
Even though this is only a P2, I felt it would be
quite bothersome for the users and might cause some
confusion.
The problem was the the wxLocale was being deleted
before all usage of it was complete. The fix was
to explicitly delete the plugin and module managers.
Fix, which is to disable that aspect, was agreed between Paul, Bill, Steve (and OI agree too) and as a TL I'm putting it into action so as not to hold up release with a P1.
This puts the single instance checker back to pre-13868
behavior, so we're back to being able to open multiple
instance if the temp directory is different in portable
settings.
The access violation has apparently been happening for
quite a while, just hidden because it happened when
additional Audacity instances were executed and the DDE
command was sent to the first instance. After sending
the command, the connection was disconnected, but the
object had already been deleted by the command execution
so a first-chance exception was triggered.
If latency was introduced by an effect, the input position could
get offset by the amount of latency, such that the same input
would be processed twice for the number of sample of latency.
There was an issue in AUs where a "latency done" flags wasn't
being reset and so the second and subsequent uses of an effect
could not latency correct.
And in research that, I found that you need to set the sample rate
on all 3 scopes (global, input, and output) instead of just the
global scope.
Command line parsing has been revised and used
for the primary Audacity command line as well as
any secondary Audacity executions.
This way if multiple filenames are included on
the secondary executions, then we now pass ALL
of the filenames instead of just the first one.
Some hosts (like Ardour) use the "user" field and some use
the resvd2 field. In 2.0.6 I'd switced from resvd2 to user.
This fix puts it back to resv2 since at least one plugin,
Audiocation Phase, uses the "user" field for its own purposes
and rightly so.
Seem there's either a critter in the wx2812 socket IPC code (the
socket processing was rewritten for the wx3 series) that could
cause Audacity to hang during startup if more than 1 file was
opened at the same time. It was hit or miss, but more hit than
miss and was likely to occur when opening multiple files in a
file manager.
This fix was to stop using the wx2 IPC code and craft our own
basic startup messaging.
The problem was that different temp directories can
be specified when using Portable Settings. This caused
the single instance checker to look for it's lock file
in different locations so it was unable to detect that
another instance was running.
This changes the directory for the lock file to be the
user's home directory (which is the default for the checker
anyway). This allow the user to still specify different
temp directories in the Portable Settings and ensure's
that only one instance (per user) ever runs.
It now checks the single instance before initializing
preferences since preferences are modified during initialization
which could interere with an already running instance.
In addition, the Mac now uses the DDE IPC startup to
ensure all files are opened by the single Audacity instance.
Normally this is not needed since we also support the OSX
mechanism for opening by an existing process. But, that
only works if the exact same Audacity.app is used. There
are instances when this is not always the case.
I also ran across a problem with language initialization.
Since preferences were initialized before the locale was set,
dialogs would be shown in English. I've made a change that sets
the language to the system language until the preferences are
loaded and then resets it to the user selected language.
The problem is that the fix for bug #334 is a bit over zealous and
blocks ALL application level events instead of just the keyboard events.
This was blocking the new AUDIOIO event from being handled.
I didn't want to monkey with the #334 solution at this time, so the
simple fix was to ensure the progress dialog was going (thus, enabling
appilcation events) was destroyed before attempting to stop the audio
stream.
Steps to reproduce:
1) Launch Audacity
2) File > New
3) Generate a sound in the new project
4) Open a LADSPA effect
5) In second project: File > Close, don't save changes.
6) In first project, generate a sound.
7) Click "Play" button - crash :-(