[getdns-api] getdns_return_t for destroy methods

Goyal, Neel ngoyal at verisign.com
Mon Mar 10 13:49:39 MST 2014

On 3/10/14, 1:13 PM, "Simon Perreault" <simon.perreault at viagenie.ca> wrote:

>Le 2014-03-10 13:04, Paul Hoffman a écrit :
>>> What we propose, is to let a getdns_context_destroy, when used from
>>> within a callback, return GETDNS_RETURN_GOOD if the
>>> library/implementation can deal with it, and
>>> if it can not.
>The problem with this is that you are proposing to use a run-time
>mechanism to fix a compile-time mistake. That's something we usually try
>to avoid.
>More appropriate IMHO would be to use an assert()-like mechanism that
>would only be activated when the appropriate debug macro is enabled. The
>very purpose of assert() is to find bugs introduced by programmer mistake.

I like the suggestion - to me this implies that the API specification
should state that calling getdns_context_destroy() on the context passed
into the getdns_callback_t is illegal.

More information about the getdns-api mailing list