Changeset 1640 for trunk/eraser6


Ignore:
Timestamp:
1/22/2010 5:57:02 AM (2 years ago)
Author:
lowjoel
Message:

Forward port from Eraser 6.0: Fixed race condition when two instance of Eraser are started simultaneously. The first instance would have created the pipe which listens for commands, then creates the program window. The second instance would find the mutex created and connect to the pipe from the first instance. The first instance broadcasts the OnNextInstance? event, but the main thread is still in the constructor of the MainForm?. The program then has a NullReferenceException?. The new behaviour is to initialise the main window before the pipe listening for new instances are created. This also allows the OnInitInstance? event to abort the startup of the program.

Location:
trunk/eraser6
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser6

  • trunk/eraser6/Eraser/Program.cs

    r1611 r1640  
    361361                try 
    362362                { 
    363                     //Create the pipe server which will handle connections to us 
    364                     pipeServer = new Thread(ServerMain); 
    365                     pipeServer.Start(); 
    366  
    367363                    //Initialise and run the program. 
    368364                    bool ShowMainForm = OnInitInstance(this); 
    369365                    if (MainForm == null) 
    370366                        return false; 
     367 
     368                    //Create the pipe server which will handle connections to us 
     369                    pipeServer = new Thread(ServerMain); 
     370                    pipeServer.Start(); 
    371371 
    372372                    //Handle the exit instance event. This will occur when the main form 
Note: See TracChangeset for help on using the changeset viewer.