malloc errors on ValentinaShutDown

Ruslan Zasukhin sunshine at public.kherson.ua
Tue Jan 20 20:54:12 CST 2004


on 1/20/04 8:29 PM, bob.wright at robins.af.mil at bob.wright at robins.af.mil
wrote:

> Name:      Bob Wright
> 
> Problem with:    VSDK
> Type of problem: crash

Hi Bob,
 
> My app under development was working ine until I added some links between my
> tables (VDK_ObjectPtr).  Now when I call ValentinaShutDown I get 8 to 10
> malloc errors 
>    "Deallocation of a pointer not malloced - could be a double
>    free(), or free called with the middle of an allocated block".

> I have isolated the source of these errors to being the construction of my
> first table which contains an VDK_ObjectPtr field.

> If I call ValentinaShutDown() immediately upon constructing this table - the
> malloc errors show up.   The program seems to work fine but the malloc errors
> bother me.
> 
> I am using Valentina SDK C++, Cocoa APIs, XCode 1.1, MacOS X.3.
> 
> Any ideas?

IF you create ObjectPtr in the FIRST table, then where it points?
On some other table I assume, yes?

But how you can point on table which you have not create yet?
Please check if this is an issue.

IF yes, then you have 2 ways:

1) change order of VDK_BaseObjects creation.

2) sometimes we have tables with recursive pointers.
So change of order will not help.
To resolve this problem, you need
    a) in the first table create VDK_ObjectPtr with NULL as target table
    b) AFTER you create all tables, assign Target table to that ObjetcPtr
        using VDK_OBjectPtr::setTarget( VDK_BaseObject* )


> Thanks,
> Bob Wright
> U. S. Air Force
> Robins AFB, GA

-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list