×
Namespaces

Variants
Actions

Archived:Symbian does not call global object destructors (Known Issue)

From Nokia Developer Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

Symbian does not invoke destructors of C++ global objects upon program termination.

Article Metadata
Compatibility
Platform(s): S60 3rd Edition
S60 3rd Edition, FP1 and FP2
S60 3rd Edition FP2
S60 3rd Edition FP1
S60 3rd Edition (initial release)
Article
Created: User:Technical writer 1 (12 Jun 2008)
Last edited: hamishwillee (19 Jun 2012)

How to reproduce

In the code below, the destructor ~foo() is never called.

  #include <iostream>
using namespace std;
 
class foo
{
public:
foo()
{
cout <<"Entering foo\n";
}
 
~foo()
{
cout <<"Leaving foo\n";
}
};
 
foo foo_bar;
 
int main(void)
{
return 0;
}

Solution

No known solution. At the moment, it is advised not to perform any important operations using destructors.

This page was last modified on 19 June 2012, at 07:59.
28 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×