Open main menu

CDOT Wiki β

Changes

Real World Mozilla First XPCOM Component

1 byte removed, 12:25, 18 November 2008
nsISupports
=== nsISupports ===
[http://developer.mozilla.org/en/docs/nsISupports nsISupports] is the base interface for all XPCOM components (i.e., it is possible to pass any XPCOM component around as an nsISupports object). The [http://developer.mozilla.org/en/docs/nsISupports methods] in nsISupports define basic bookkeeping for an interface's lifetime (they also defines define a way to check at runtime if a component implements a given interface, but more on that later).
Components need to keep track of how many clients hold references to them via an interface. This is known as '''reference counting''' on an interface, and it is used to determine when a component can be safely unloaded so that it doesn't leak (i.e., no one holds a reference any more, but the interface is still in memory).
1
edit