freetype-devel
[Top][All Lists]
Advanced

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

Re: [Devel] Memory issue


From: David Turner
Subject: Re: [Devel] Memory issue
Date: Tue, 05 Dec 2000 12:18:26 +0100

Hi Ryan,

> 
> I am creating my own memory management scheme, and wish to know if I am
> doing this correctly.  If so, there appears to be a bug in that the free
> call doesn't execute appropriately.
> 
> I have created my own memory structure having the following:
> 
>       memory->user    = 0;
>       memory->alloc   = ttf_alloc;
>       memory->realloc = ttf_realloc;
>       memory->free    = ttf_free;
> 
> When the library is done, however, I call FT_Done_FreeType - which calls
> FT_Done_Memory which performs
> 
>     free( memory, memory );
> 
> which is not my desired effect.  Should I recreate a function like
> FT_Done_FreeType, or is this a problem?
> 

Actually, it certainly a bug, because the line should read

  memory->free( memory )

I've fixed this on the CVS.

By the way. You should call FT_Done_FreeType if you want to destroy
the memory manager. Otherwise, simply call FT_Done_Library(), it
will destroy the FT_Library and all child objects, and leave you
the care of cleaning the FT_Memory

Thanks,

- David



reply via email to

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