Skip to content
Snippets Groups Projects
Commit 52520e65 authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Fix for texture object destroyed bug

parent d09d5b38
No related branches found
No related tags found
No related merge requests found
Pipeline #12495 passed
......@@ -59,10 +59,12 @@ class TextureObject {
void download(cv::Mat &, cudaStream_t stream=0) const;
__host__ void free() {
if (texobj_ != 0) cudaSafeCall( cudaDestroyTextureObject (texobj_) );
if (ptr_ && needsfree_) cudaFree(ptr_);
ptr_ = nullptr;
texobj_ = 0;
if (needsfree_) {
if (texobj_ != 0) cudaSafeCall( cudaDestroyTextureObject (texobj_) );
if (ptr_) cudaFree(ptr_);
ptr_ = nullptr;
texobj_ = 0;
}
}
private:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment