View Issue Details

IDProjectCategoryView StatusLast Update
0031619FPCDocumentationpublic2018-07-25 20:58
ReporterAfrican Wild DogAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityN/A
Status closedResolutionfixed 
Product VersionProduct Build 
Target Version3.2.0Fixed in Version3.1.1 
Summary0031619: Details about contructors is missing from documentation
Description* The documentation should mention that, when a exception is raised inside a constructor, the destructor is automatically invoked;

* The documentation should mention that the fields of a instance is automatically "zeroed" by the compiler;
TagsNo tags attached.
Fixed in Revision1408
FPCOldBugId
FPCTarget
Attached Files

Activities

African Wild Dog

2017-04-01 00:38

reporter   ~0099317

As sven pointed out:

"Keep in mind however that the second behavior can be changed by overriding TObject.NewInstance (the default implementation allocates the memory of the class and zeroes it)."

Thaddy de Koning

2017-04-01 13:59

reporter   ~0099329

"* The documentation should mention that, when a exception is raised inside a constructor, the destructor is automatically invoked;"
This is afaik not correct if the exception is fatal. Like EOutOfMemory.
It is also not correct if the exception is actually handled inside the constructor.

African Wild Dog

2017-04-07 17:32

reporter   ~0099474

"This is afaik not correct if the exception is fatal. Like EOutOfMemory.
It is also not correct if the exception is actually handled inside the constructor."

So, the documentation should mention that, if an exception is fatal or if an exception is handled inside a constructor, the destructor is not invoked, otherwise the destructor will be invoked.

Michael Van Canneyt

2017-04-22 14:36

administrator   ~0099773

Added some comments about this in the 'class instantiation' section.

Issue History

Date Modified Username Field Change
2017-03-31 19:22 African Wild Dog New Issue
2017-03-31 19:22 African Wild Dog Status new => assigned
2017-03-31 19:22 African Wild Dog Assigned To => Michael Van Canneyt
2017-04-01 00:38 African Wild Dog Note Added: 0099317
2017-04-01 13:59 Thaddy de Koning Note Added: 0099329
2017-04-07 17:32 African Wild Dog Note Added: 0099474
2017-04-22 14:36 Michael Van Canneyt Fixed in Revision => 1408
2017-04-22 14:36 Michael Van Canneyt Note Added: 0099773
2017-04-22 14:36 Michael Van Canneyt Status assigned => resolved
2017-04-22 14:36 Michael Van Canneyt Fixed in Version => 3.1.1
2017-04-22 14:36 Michael Van Canneyt Resolution open => fixed
2017-04-22 14:36 Michael Van Canneyt Target Version => 3.2.0
2018-07-25 20:58 African Wild Dog Status resolved => closed