Why check NPP instance != NULL?
Oleksandr Gavenko <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.plugins |
|---|---|
| Message-ID | <[email protected]> |
I check:
http://devedge-temp.mozilla.org/library/manuals/2002/plugin/1.0/plugin.pdf
and many sources from:
http://www.google.com/codesearch?hl=ru&lr=&q=lang%3Ac|c\%2B\%2B+return+NPERR_INVALID_INSTANCE_ERROR%3B
They use such pattern:
if (instance==NULL)
return NPERR_INVALID_INSTANCE_ERROR;
for functions that pass 'NPP instance' arg (like NPP_New, NPP_Destroy,
NPP_GetValue).
Why this need?
Is is possible that browser pass NULL in 'NPP instance' arg?
NOTE: that browser simply can do not invoke func if it know
that NPP object is NULL
NOTE: function call with NULL is not useful useful.
I can not get situation when to NPP_New or NPP_Destroy passed NULL
in Firefox, Opera, Chrome and Safary (most recent stable version
under Windows).
--
Best regards!