freetype-devel
[Top][All Lists]
Advanced

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

Re: [Devel] patch, allow custom streams to delete themselves


From: Werner LEMBERG
Subject: Re: [Devel] patch, allow custom streams to delete themselves
Date: Wed, 11 Aug 2004 06:52:09 +0200 (CEST)

Danny wrote a few weeks ago:

> When using custom stream objects it would be nice to be able to
> delete the FT_STREAM from within our custom close function as to
> decrease the amount of redundant bookkeeping we do.  If you try to
> delete it from your close function the program will crash accessing
> invalid memory.  The problem is that the stream->close function
> pointer is set to 0 after the stream is closed so you can't close it
> twice.  I looked through the code and I ran some test cases but
> couldn't get any cases where this extra test came in useful.  Most
> of the time stream is set equal to NULL right after closing or freed
> internally anyway.
> 
> This little patch makes it possible for you to delete your custom
> STREAM when it is closed by removing the extra assignment and check.
> I've been using this fix since I mentioned the problem to the
> FreeType (not devel) mailing list the 16th.

Thanks for the patch.  I've applied it to the CVS (slightly modified).
Please test.


    Werner



reply via email to

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