Allocation Conflict Error

From: Majuer (silviashe_at_hotmail.com)
Date: 10/31/03


Date: 31 Oct 2003 11:41:06 -0800

Hi,
I have a class in one DLL. Something like this:
class CLASS1
{
        MyData* pData;
        CLASS1()
        {
                pData = NULL;
        }
        Load()
        {
                pData = new MyData;
        }

        ~CLASS1()
        {
               if (pData)
                  pData = delete pData;
        }
}
Then in another DLL.
I have
CLASS1 myClass;
myClass.Load();
...

For release build, in boundscheker, I got this error message at the
destructor of CLASS1 (pData = delete pData;)

Allocation Conflict: Attempting to call global_operator_delete on
pointer 0x322E5D8, that was allocated by HeapAlloc.

Why the "new" was using HeapAlloc while the "delete" use
"global_operator_delete"(defined in afx.inl)?

Thanks!



Relevant Pages

  • Re: Function scope in a class module
    ... Dim o As Class1 ... Dim i As Integer ... Also note that you should declare the function as Friend unless you plan ... to use it from outside of the DLL. ...
    (microsoft.public.vb.general.discussion)
  • Re: eigene DLLs
    ... Aber wie schreibe ich die DLL? ... Public Class Class1 ... Public Function nachricht() As Int16 ...
    (microsoft.public.de.german.entwickler.dotnet.vb)
  • Restricting Inheriting Scope of a class
    ... Class1 is base class for class2 ... It's a DLL project. ... What my problem is i want only class2 ... and class3 to be viewed as the part of the DLL and Class1 should be ...
    (microsoft.public.dotnet.framework)
  • Re: Restricting Inheriting Scope of a class
    ... Class1 is base class for class2 ... It's a DLL project. ... What my problem is i want only class2 ... want to create any other DLL for my Base class Class1. ...
    (microsoft.public.dotnet.framework)
  • Linking eVC4.0 in DOT NET
    ... If I created a simple Managed C++ DLL and use this dll in VB>NET CF it ... class myMath ... public __gc class Class1 ...
    (microsoft.public.windowsce.embedded.vc)