use of php.runtime.lang.support.IManualDestructable in project jphp by jphp-compiler.
the class ObjectMemory method manualUnset.
@Override
public void manualUnset(Environment env) {
ClassEntity entity = value.getReflection();
if (entity.methodDestruct != null) {
if (!value.isFinalized()) {
value.doFinalize();
env.pushCall(value, entity.methodDestruct.getName());
try {
if (value instanceof IManualDestructable) {
((IManualDestructable) value).onManualDestruct(env);
}
entity.methodDestruct.invokeDynamic(value, env);
} catch (InvocationTargetException e) {
env.__throwException(e);
} catch (RuntimeException e) {
throw e;
} catch (Throwable throwable) {
throw new CriticalException(throwable);
} finally {
env.popCall();
}
}
}
}
Aggregations