Skip to content

Instantly share code, notes, and snippets.

@RoryDungan
Created May 29, 2018 06:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RoryDungan/4c24b1b3c35f5e03f3083cf6948fcab0 to your computer and use it in GitHub Desktop.
Save RoryDungan/4c24b1b3c35f5e03f3083cf6948fcab0 to your computer and use it in GitHub Desktop.
void DereferenceManagedObject(int32_t handle)
{
assert(handle >= 0 && handle < managedObjectsRefCountLen);
if (handle != 0)
{
auto numRemain = --managedObjectRefCounts[handle];
assert(numRemain >= 0);
if (numRemain <= 0)
{
ReleaseObject(handle);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment