pixelBuffers.push_back(textureInfo.pixelBuffer);
UploadTextures(pixelBuffers, textureInfo);
+ // Increase reference counts for notify required textureId.
+ // Now we can assume that we don't remove & re-assign this textureId
+ // during NotifyObserver signal emit.
+ maskTextureInfo.referenceCount++;
+ textureInfo.referenceCount++;
+
notifyRequiredTextureIds.push_back(textureInfo.textureId);
}
}
pixelBuffers.push_back(textureInfo.pixelBuffer);
UploadTextures(pixelBuffers, textureInfo);
+ // Increase reference counts for notify required textureId.
+ // Now we can assume that we don't remove & re-assign this textureId
+ // during NotifyObserver signal emit.
+ maskTextureInfo.referenceCount++;
+ textureInfo.referenceCount++;
+
notifyRequiredTextureIds.push_back(textureInfo.textureId);
}
}
NotifyObservers(textureInfo, true);
}
}
+
+ // Decrease reference count
+ for(const auto textureId : notifyRequiredTextureIds)
+ {
+ Remove(textureId, nullptr);
+ }
}
void TextureManager::ApplyMask(TextureManager::TextureInfo& textureInfo, const TextureManager::TextureId& maskTextureId)