message: fixed bug in C++ API
diff: @@ -56,6 +56,7 @@ namespace OIDN {
  Buffer(const Buffer& other) : handle(other.handle)
  {
  + if (handle)
  oidnRetainBuffer(handle);
  }
  @@ -68,6 +69,7 @@ namespace OIDN {
  {
  if (&other != this)
  {
  + if (other.handle)
  oidnRetainBuffer(other.handle);
  if (handle)
  oidnReleaseBuffer(handle);
  @@ -84,6 +86,7 @@ namespace OIDN {
  Buffer& operator =(OIDNBuffer other)
  {
  + if (other)
  oidnRetainBuffer(other);
  if (handle)
  oidnReleaseBuffer(handle);
  @@ -93,6 +96,7 @@ namespace OIDN {
  ~Buffer()
  {
  + if (handle)
  oidnReleaseBuffer(handle);
  }
  @@ -114,6 +118,7 @@ namespace OIDN {
  Filter(const Filter& other) : handle(other.handle)
  {
  + if (handle)
  oidnRetainFilter(handle);
  }
  @@ -126,6 +131,7 @@ namespace OIDN {
  {
  if (&other != this)
  {
  + if (other.handle)
  oidnRetainFilter(other.handle);
  if (handle)
  oidnReleaseFilter(handle);
  @@ -142,6 +148,7 @@ namespace OIDN {
  Filter& operator =(OIDNFilter other)
  {
  + if (other)
  oidnRetainFilter(other);
  if (handle)
  oidnReleaseFilter(handle);
  @@ -151,6 +158,7 @@ namespace OIDN {
  ~Filter()
  {
  + if (handle)
  oidnReleaseFilter(handle);
  }
  @@ -200,6 +208,7 @@ namespace OIDN {
  Device(const Device& other) : handle(other.handle)
  {
  + if (handle)
  oidnRetainDevice(handle);
  }
  @@ -212,6 +221,7 @@ namespace OIDN {
  {
  if (&other != this)
  {
  + if (other.handle)
  oidnRetainDevice(other.handle);
  if (handle)
  oidnReleaseDevice(handle);
  @@ -228,6 +238,7 @@ namespace OIDN {
  Device& operator =(OIDNDevice other)
  {
  + if (other)
  oidnRetainDevice(other);
  if (handle)
  oidnReleaseDevice(handle);
  @@ -237,6 +248,7 @@ namespace OIDN {
  ~Device()
  {
  + if (handle)
  oidnReleaseDevice(handle);
  }
  