Migrate from GitHub to SourceForge with this tool. Check out all of SourceForge's recent improvements.
Close

#1723 Crash when starting a second instance

Branch_+_Trunk
closed-fixed
None
5
2008-06-15
2008-06-14
No

2.8.2 and 2.9.1.3

Steps to reproduce:

1. Enable "Allow only one stance to run"

2. Start WinMerge with some parameters.
ex. "c:\program files\winmerge\winmergeu.exe" c:\ d:\

3. Start a second WinMerge instance without parameters.
then crash occurs.

ex. "c:\program files\winmerge\winmergeu.exe"

Patch:

There is a bug in the code where to free allocated memory of command line parameters.

Index: MainFrm.cpp

--- MainFrm.cpp (revision 5479)
+++ MainFrm.cpp (working copy)
@@ -2737,7 +2737,7 @@
theApp.ParseArgsAndDoOpen(cmdInfo, this);

// Delete memrory allocated in OnCopyData method.

- for (int i = 0; i < argc; ++i)
+ for (int i = 0; i < __argc; ++i)
{
delete[] __targv[i];
}

Discussion

  • Kimmo Varis

    Kimmo Varis - 2008-06-15

    Logged In: YES
    user_id=631874
    Originator: NO

    Looks good. Please apply to both SVN trunk and 2.8 branch.

     
  • Takashi Sawanaka

    • status: open --> closed
     
  • Takashi Sawanaka

    Logged In: YES
    user_id=954028
    Originator: YES

    Commited to SVN trunk. Completed: At revision: 5480
    Commited to 2.8 Branch. Completed: At revision: 5481

     
  • Takashi Sawanaka

    • assigned_to: nobody --> sdottaka
    • status: closed --> closed-fixed
     

Log in to post a comment.