diff --git a/lib/src/Data/DataSerializer.dart b/lib/src/Data/DataSerializer.dart index 1c1f938..f1e9331 100644 --- a/lib/src/Data/DataSerializer.dart +++ b/lib/src/Data/DataSerializer.dart @@ -122,7 +122,7 @@ class DataSerializer { return DataSerializerComposeResults( TransmissionTypeIdentifier.Null, DC(0)); - var cts = template.constants.where((x) => x.value == value); + var cts = template.constants.where((x) => x.value == value.value); if (cts.isEmpty) return DataSerializerComposeResults( diff --git a/lib/src/Resource/Instance.dart b/lib/src/Resource/Instance.dart index a999620..20e9c75 100644 --- a/lib/src/Resource/Instance.dart +++ b/lib/src/Resource/Instance.dart @@ -45,6 +45,10 @@ class Instance extends IEventHandler { int _id; + bool _isDestroyed; + + bool get isDestroyed => _isDestroyed; + /// /// Instance attributes are custom properties associated with the instance, a place to store information by IStore. /// @@ -619,6 +623,7 @@ class Instance extends IEventHandler { } void resource_OnDestroy(sender) { + _isDestroyed = true; emitArgs("resourceDestroyed", [sender]); } } diff --git a/lib/src/Resource/Warehouse.dart b/lib/src/Resource/Warehouse.dart index 8d87305..cfadfdc 100644 --- a/lib/src/Resource/Warehouse.dart +++ b/lib/src/Resource/Warehouse.dart @@ -670,6 +670,8 @@ class Warehouse { resource.destroy(); + resource.instance = null; + return true; }