freetype
[Top][All Lists]
Advanced

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

Re: [ft] FT_Done_Face Should Not Return An Error


From: Lawrence D'Oliveiro
Subject: Re: [ft] FT_Done_Face Should Not Return An Error
Date: Thu, 10 May 2018 10:29:11 +1200

On Wed, 09 May 2018 14:11:19 +0200 (CEST), Werner LEMBERG wrote:

> IMHO, `FT_Done_Face' shouldn't return an error code
> at all.

Glad you finally agree. So how to fix it?

* For backward compability, it should continue to return FT_Err_Ok.
* So what should the code do if the FT_List_Find call returns NULL?
  I think it should print a message to stderr and abort the program.

Ignoring the internal consistency failure is not really a good idea. It
is very likely an indication that memory blocks are screwed. So if the
code just tries to keep going, it could hit a segfault later on, or
otherwise behave unpredictably. And then the programmer is left
scratching their head as to what went wrong. By reporting the problem
as close as possible to the point of its discovery, you maximize the
chance that it can be found and fixed.



reply via email to

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