Re: g_object_unref



Hi,

Neil Zanella <nzanella gmail com> writes:

> Is it OK to call g_object_unref() on a NULL pointer (with nothing
> happening)?

Use the source, Luke.

A quick view at the source code clearly shows that, no, it is not OK.

> (and I think this should be mentioned in the docs)

The docs explicitely mention whenever it is OK to pass NULL. If they
don't, it is very likely that it is not OK and even if it works, it
isn't safe to assume that it will work in the future. Only if NULL is
explicitely documented as being allowed, you can rely on it.


Sven



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