> if (scriptablePeer)
> {
> // ... told them the browser
> *(nsISupports **)value = scriptablePeer;
here, you probably want scriptablePeer.get();
also, when assigning to a raw pointer, you're not going to get automatic
addref'ing - so you have to say
// still need to ADDREF because "value" is not a nsCOMPtr
*(nsISupports**)value = scriptablePeer.get();
NS_ADDREF(*(nsISupports**)value);
my suggestion would be at least to use an intermediary pointer to make
this readable:
// assign-and-addref is a common pattern
nsISupports* result = scriptablePeer.get();
NS_ADDREF(result);
// now do the funky casting
*(nsISupports**)value = result;
Alec