help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Crossplatform and templates


From: Simon Buchan
Subject: Re: Crossplatform and templates
Date: Tue, 11 Oct 2005 19:52:22 +1300
User-agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)

ernesto wrote:
Hi everybody:

I do not know if this is the right newsgroup to post my question, but
any help or tip will be very appreciated.

I am writing (from the scratch) a cross platform C++ library to handle
data structures (linked lists, hash tables, etc.); I am also using a
reference counter MPtr<T> that all my data structures use.

All the objects that I work are instances of my MObject class, that has
a mRefCount attribute and a static instanceCount that indicates how
many objects are alive now (it gives me some view about leaked
objects).

Ok, my code works perfectly with Visual C++ 8.0, but when I compile it
using mingw and gcc 3.4.1 on another platforms (like FreeBSD), it
returns me a lot of non deleted objects.

Using the gdb, I noticed that sometimes the destructor of the
referenced object is not called from my MPtr<T>::~MPtr().

Are there some "liberties" working with Visual C++ 8 that are no part
of the standard C++? A gcc bug? A "good luck bug" from me? Maybe gcc
4.0 can have the answer?

Thanks in advance, saludos

ernesto

Noone can tell you exactly without a minimal (< 50 lines) compilable program that exibits this. However, I don't think I'm making too much of an assumption that this is VC++'s fault. ;-)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]