/** * Destroy a object * * @param Object $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}); } } }); }