When to use ReleaseVariantValue() is not clear to me, I already read
https://developer.mozilla.org/en/NPN_ReleaseVariantValue
http://dev.opera.com/articles/view/the-opera-plug-in-interface/#NPN_ReleaseVariantValue
Can you please tell me in which usecase shall we use it?
You can uses this to flush the value held for any variant - string, object etc. The browser internally clears the value based on the object type. This may also mean deallocating memory
As per MDC,
"This must always be called on result variants and such in this API, i.e. any NPVariant whose value comes from a call that passes back an NPVariant must be released using this function. "
So, if you use some calls that put the result in an (NPVariant *) like NPN_Invoke() or NPN_GetProperty(), you should use NPN_ReleaseVariantValue() to clear them
See also: http://colonelpanic.net/2009/12/memory-management-in-npapi/