gui\Application::destroyObject PHP Method

destroyObject() public method

Destroy a object
public destroyObject ( Object $object ) : void
$object Gui\Components\Object Component Object
return void
    public function destroyObject(Object $object)
    {
        $application = $this;
        $this->sendCommand('destroyObject', [$object->getLazarusObjectId()], function ($result) use(&$object, $application) {
            if ($result == $object->getLazarusObjectId()) {
                if ($application->getObject($result)) {
                    unset($object, $application->{$result});
                }
            }
        });
    }