View Issue Details

IDProjectCategoryView StatusLast Update
0021458FPCRTLpublic2017-03-16 14:49
ReporterMartin FriebeAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformw32OSw32OS Versionvista
Product Version2.6.0Product Build 
Target Version3.2.0Fixed in Version3.1.1 
Summary0021458: FreeNotification and opRemove leads to crash
Descriptionsee the program below.

It crashes because opRemove removes one of the 2 paired FreeNotification and lets the other in place.

It works well in Delphi.

http://lists.freepascal.org/lists/fpc-devel/2012-March/028564.html
Steps To Reproduce

program Project1;
{$mode objfpc}{$H+}
uses Classes;
var
  Owner, C1, C2: TComponent;
begin
  Owner := TComponent.Create(nil);
  C1 := TComponent.Create(Owner);
  C2 := TComponent.Create(Owner);

  C1.FreeNotification(c2);

  Owner.RemoveComponent(C1); // C2 Gets on opRemove
  C2.Free;
  C1.Free; // crash

  ReadLn;
end.
TagsNo tags attached.
Fixed in Revisioncompon.inc
FPCOldBugId
FPCTarget
Attached Files

Relationships

related to 0020808 closedMichael Van Canneyt ReferenceInterface(opInsert) is broken 

Activities

Marco van de Voort

2012-03-11 21:55

manager   ~0057493

Just calling acomponent.freeremovenotifcation(self) would introduce cycles.

Move the current implementation to a new method (internalfreeremovenotification?) and then call

  internalfreenotification(acomponent);
  acomponent.internalfreenotification(self);

in FreeRemoveNotification?

Michael Van Canneyt

2017-03-16 14:49

administrator   ~0098949

Fixed.

Issue History

Date Modified Username Field Change
2012-03-11 15:17 Martin Friebe New Issue
2012-03-11 21:55 Marco van de Voort Note Added: 0057493
2012-03-24 18:22 Marco van de Voort Relationship added related to 0020808
2017-03-16 14:49 Michael Van Canneyt Fixed in Revision => compon.inc
2017-03-16 14:49 Michael Van Canneyt Note Added: 0098949
2017-03-16 14:49 Michael Van Canneyt Status new => resolved
2017-03-16 14:49 Michael Van Canneyt Fixed in Version => 3.1.1
2017-03-16 14:49 Michael Van Canneyt Resolution open => fixed
2017-03-16 14:49 Michael Van Canneyt Assigned To => Michael Van Canneyt
2017-03-16 14:49 Michael Van Canneyt Target Version => 3.2.0