Skip to content

Commit

Permalink
.NET: ManagedObject sanity checks
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Mar 24, 2024
1 parent 354d22a commit 8474052
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions csharp-api/REFrameworkNET/ManagedObject.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ public ref class ManagedObject : public System::Dynamic::DynamicObject, public S
{
public:
ManagedObject(reframework::API::ManagedObject* obj) : m_object(obj) {
AddRef();
if (obj != nullptr) {
AddRef();
}
}
ManagedObject(::REFrameworkManagedObjectHandle handle) : m_object(reinterpret_cast<reframework::API::ManagedObject*>(handle)) {
AddRef();
if (handle != nullptr) {
AddRef();
}
}

~ManagedObject() {
Expand Down

0 comments on commit 8474052

Please sign in to comment.