Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0003990 [JEDI VCL] 00 JVCL Components minor always 2006-11-06 21:14 2007-10-12 04:54
Reporter Kiriakos View Status public  
Assigned To obones
Priority normal Resolution fixed  
Status resolved   Product Version 3.20
Summary 0003990: JvAppInstances.Check fails if many instances are started in short tiime interval
Description JvAppInstances.Check uses the following if statement to check whether in needs to shut down.

if AppInstances.InstanceCount > MaxInstances then

The problem with this statement is that if many instances are started in a short time interval and given that instances are registered at component creation while the Check occurs when the form is loaded, it is possible that the check may fail for all instances.

Replace with the following:

if AppInstances.InstanceIndex[GetCurrentProcessId] >= MaxInstances then

Another related bug is that the Check method calls
  TerminateProcess(GetCurrentProcess, 0);

to stop the instance. This is OK but it will not call the destructor of TJvAppInstances.AppInstances which calls RemoveInstance. In other words the InstanceCount will not be decreased when this instance is terminated. To resolve add the following Statement before the Terminate statement:

    AppInstances.Free; // Calls protected method RemoveInstance

Additional Information
Tags No tags attached.
Attached Files

- Relationships

-  Notes
obones (administrator)
2006-11-08 08:54

The second part, I'm quite sure it is fixed in the SVN version.
As to the first part, it might have been fixed as well.

Please use the more recent version and let us know. [^]
Kiriakos (reporter)
2006-11-08 13:29

Indeed the second issue has been fixed but the first remains.
Kyle_Katarn (reporter)
2007-06-15 13:41
edited on: 2007-06-15 13:57

Bug confirmed for 1st part using latest available build.

Proposed solution fixes the problem flawlessly.

Obones, please apply for implementation

Kyle_Katarn (reporter)
2007-06-15 13:52

Even with proposed fix crashes if multiple instances are created "simultaneously"
obones (administrator)
2007-06-20 03:32

So in the end, what should be done?
Kyle_Katarn (reporter)
2007-06-20 11:57

Conclusion of a deeper investigation :
- Crash was due to a mistake on my side : proposed solution is SAFE.

BUT it still has to be benckmarked because if multiple instances are loaded simultaneously (if the application is loaded thru the context menu of a selection of multiple files) it seems that sometimes all occurences are rejected.

Am i clear (not a native english speaker...) or do you need more details ?
obones (administrator)
2007-10-12 04:54

Proposed fix is in SVN.
The potential bug with multi launch from the explorer will have to be looked at independently if it ever occurs.

- Issue History
Date Modified Username Field Change
2006-11-06 21:14 Kiriakos New Issue
2006-11-08 08:54 obones Note Added: 0010425
2006-11-08 08:54 obones Status new => feedback
2006-11-08 13:29 Kiriakos Note Added: 0010426
2007-06-15 13:41 Kyle_Katarn Note Added: 0013328
2007-06-15 13:52 Kyle_Katarn Note Added: 0013329
2007-06-15 13:57 Kyle_Katarn Note Edited: 0013328
2007-06-20 03:32 obones Note Added: 0013496
2007-06-20 11:57 Kyle_Katarn Note Added: 0013501
2007-10-12 04:54 obones Status feedback => resolved
2007-10-12 04:54 obones Fixed in Version => Daily / SVN
2007-10-12 04:54 obones Resolution open => fixed
2007-10-12 04:54 obones Assigned To => obones
2007-10-12 04:54 obones Note Added: 0013912

Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker