NS_NEWXPCOM(inst, nsDeviceContextBeOS);
NS_NEWXPCOM(inst, nsRenderingContextBeOS);
nsresult nsGfxFactoryBeOS::CreateInstance(nsISupports *aOuter,                                            const nsIID &aIID,                                            void **aResult)  {    if (aResult == NULL) {      return NS_ERROR_NULL_POINTER;    }    *aResult = NULL;      nsISupports *inst = nsnull;  if (mClassID.Equals(kCFontMetrics)) {    NS_NEWXPCOM(inst, nsFontMetricsBeOS);  }  else if (mClassID.Equals(kCDeviceContext)) {    NS_NEWXPCOM(inst, nsDeviceContextBeOS);  }  else if (mClassID.Equals(kCRenderingContext)) {    NS_NEWXPCOM(inst, nsDeviceContextBeOS);  }  else if (mClassID.Equals(kCImage)) {    NS_NEWXPCOM(inst, nsImageBeOS);  }  else if (mClassID.Equals(kCRegion)) {    NS_NEWXPCOM(inst, nsRegionBeOS);  }  else if (mClassID.Equals(kCDeviceContextSpec)) {    NS_NEWXPCOM(inst, nsDeviceContextSpecBeOS);  }  else if (mClassID.Equals(kCDeviceContextSpecFactory)) {    NS_NEWXPCOM(inst, nsDeviceContextSpecFactoryBeOS);  }          	  if (inst == NULL) {      return NS_ERROR_OUT_OF_MEMORY;    }    nsresult res = inst->QueryInterface(aIID, aResult);  if (res != NS_OK) {      // We didn't get the right interface, so clean up      delete inst;    }  //  else {//    inst->Release();//  }  return res;  }  