コード例 #1
0
ファイル: asui_scriptevent.cpp プロジェクト: Picmip/qfusion
	void releaseFunctionPtr() {
		if( released ) {
			return;
		}

		released = true;
		funcPtr.release();

		if( target ) {
			target->RemoveReference();
			target = NULL;
		}
	}
コード例 #2
0
ファイル: Inventory.cpp プロジェクト: DolceTriade/libRocket
// Adds a brand-new item into this inventory.
void Inventory::AddItem(const Rocket::Core::String& name)
{
	if (document == NULL)
		return;

	Rocket::Core::Element* content = document->GetElementById("content");
	if (content == NULL)
		return;

	// Create the new 'icon' element.
	Rocket::Core::Element* icon = Rocket::Core::Factory::InstanceElement(content, "icon", "icon", Rocket::Core::XMLAttributes());
	icon->SetInnerRML(name);
	content->AppendChild(icon);

	// Release the initial reference on the element now that the document has it.
	icon->RemoveReference();
}