void UActorComponent::DestroyComponent() { // First, unregister if registered if(IsRegistered()) { UnregisterComponent(); } // Then remove from Components array, if we have an Actor AActor* Owner = GetOwner(); if(Owner != NULL) { Owner->SerializedComponents.Remove(this); if (Owner->GetRootComponent() == this) { Owner->SetRootComponent(NULL); } } // Tell the component it is being destroyed OnComponentDestroyed(); // Finally mark pending kill, to NULL out any other refs MarkPendingKill(); }
void UActorComponent::DestroyComponent(bool bPromoteChildren/*= false*/) { // Avoid re-entrancy if (bIsBeingDestroyed) { return; } bIsBeingDestroyed = true; if (bHasBegunPlay) { EndPlay(EEndPlayReason::Destroyed); } // Ensure that we call UninitializeComponent before we destroy this component if (bHasBeenInitialized) { UninitializeComponent(); } // Unregister if registered if(IsRegistered()) { UnregisterComponent(); } // Then remove from Components array, if we have an Actor if(AActor* MyOwner = GetOwner()) { if (IsCreatedByConstructionScript()) { MyOwner->BlueprintCreatedComponents.Remove(this); } else { MyOwner->RemoveInstanceComponent(this); } MyOwner->RemoveOwnedComponent(this); if (MyOwner->GetRootComponent() == this) { MyOwner->SetRootComponent(NULL); } } // Tell the component it is being destroyed OnComponentDestroyed(); // Finally mark pending kill, to NULL out any other refs MarkPendingKill(); }
static PyObject *CmpObj_UnregisterComponent(ComponentObject *_self, PyObject *_args) { PyObject *_res = NULL; OSErr _err; #ifndef UnregisterComponent PyMac_PRECHECK(UnregisterComponent); #endif if (!PyArg_ParseTuple(_args, "")) return NULL; _err = UnregisterComponent(_self->ob_itself); if (_err != noErr) return PyMac_Error(_err); Py_INCREF(Py_None); _res = Py_None; return _res; }
STDAPI DllUnregisterServer(void) { UnregisterComponent(CLSID_StartMenu); UnregisterComponent(CLSID_MenuDeskBar); UnregisterComponent(CLSID_MenuBand); UnregisterComponent(CLSID_MenuBandSite); UnregisterComponent(CLSID_MergedFolder); UnregisterComponent(CLSID_RebarBandSite); return S_OK; }