close method
Implementation
@override
Future<void> close() async {
Phidget.unregisterInstance(identityHashCode(this));
if (!attachStreamController.isClosed) await attachStreamController.close();
if (!detachStreamController.isClosed) await detachStreamController.close();
if (!errorStreamController.isClosed) await errorStreamController.close();
if (_handle != null) {
final pDelete = calloc<bindings.StepperHandle>();
pDelete.value = _handle!;
try {
bindings.phidgetClose(_handle!);
} catch (_) {}
try {
bindings.stepperDelete(pDelete);
} catch (_) {
} finally {
calloc.free(pDelete);
}
_handle = null;
}
if (isAttached) {
internalProcessDetach();
}
isAttached = false;
}