View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0003879||JEDI VCL||00 JVCL Components||public||2006-08-30 05:00||2006-08-30 07:23|
|Product Version||Daily / GIT|
|Target Version||Fixed in Version||3.30|
|Summary||0003879: TJvTabBar is broken in the latest SVN snapshot|
|Description||If you have a TJvTabBar on the form and it contains at least one tab, you will experience a crash (access violation) as soon as you try to close/destroy the form. I've tested this with daily SVN JCL/JVCL build (both are dated 2006-08-29).|
|Steps To Reproduce||1. Create a new Delphi for Win32 project|
2. Drop TJvTabBar on the form
3. Add at least one tab item
4. Compile and run the project
5. Try to close the main form and crash follows.
|Additional Information||I have debugged this problem and came to the following conclusion:|
1. When TJvTabBar is being destroyed, it tries to free the internal tab item collection it holds by calling "FreeAndNil(FTabs);" in the TJvTabBar.Destroy method.
2. This in turn causes a series of method calls to occur, namely invoking the destructor of FTabs collection which in turn tries to remove the items one by one.
3. The next method called in this chain is TJvTabBarItems.Notification which contains the following code snippet:
if TabBar.LeftTab = Item then
TabBar.LeftTab := TabBar.LeftTab.GetPreviousVisible;
The problem occurs while accessing the LeftTab property of TabBar because the getter method GetLeftTab tries to access the FTabs.Count property but since the TJvTabBar destructor uses FreeAndNil to free the tabs collection, the private field FTabs is already NILLED at this time, this is why the AV occurs.
Proposed fix: Replace this line in TJvTabBar.Destroy method:
by this one:
I've recompiled the JVCL installation on my machine and the problem no longer occurs. So I'd say this fix works just fine for me.
|Tags||No tags attached.|
|2006-08-30 05:00||ivobauer||New Issue|
|2006-08-30 07:23||obones||Status||new => resolved|
|2006-08-30 07:23||obones||Fixed in Version||=> Daily / SVN|
|2006-08-30 07:23||obones||Resolution||open => fixed|
|2006-08-30 07:23||obones||Assigned To||=> obones|
|2006-08-30 07:23||obones||Note Added: 0010035|