Repository navigation
Fix texture leak in TexturePoolHolder - #5141
Conversation
| } | ||
| } | ||
| ids.fill(0); | ||
| std::for_each(ids.begin(), ids.end(), [&](GLuint& id) { |
There was a problem hiding this comment.
Why the switch from range-based for to for_each?
There was a problem hiding this comment.
You are right, I can achieve the same thing capturing a non-const reference in a range-based for.
dc597ef to
0b7277b
Compare
|
The intended invariant is that if I think the actual bug lies in the implementations of the move constructors and |
|
Here's how I would do if implementing this pattern from scratch:
|
0b7277b to
b9351dd
Compare
|
@jfirebaugh my previous implementation used |
There was a problem hiding this comment.
The return needs to revert back to a conditional.
There was a problem hiding this comment.
Ah yes, meant continue there.
b9351dd to
78a26b7
Compare
There was a problem hiding this comment.
Why did you change o.id = 0 to id = 0? Isn't the former correct?
Fixes an issue where a moved {GL,TexturePool}Holder would use an invalid
pointer when accessing 'objectStore'.
Fixes #5136.
Prevents confusing usage of GL holder objects.
78a26b7 to
c111250
Compare
|
We'll proceed with @jfirebaugh's suggestion from #5141 (comment) in a separate PR. |
Source: https://github.com/okdshin/unique_resource These replace the complexity of manually handling moveable-RAII objects with a type specific for that purpose. As suggested in #5141 (comment).
Source: https://github.com/okdshin/unique_resource These replace the complexity of manually handling moveable-RAII objects with a type specific for that purpose. As suggested in #5141 (comment).
Source: https://github.com/okdshin/unique_resource These replace the complexity of manually handling moveable-RAII objects with a type specific for that purpose. As suggested in #5141 (comment).
Source: https://github.com/okdshin/unique_resource These replace the complexity of manually handling moveable-RAII objects with a type specific for that purpose. As suggested in #5141 (comment).
Hey @jfirebaugh, i came across this recently and was wondering if you would still do it this way. Why is the unique_resource.hpp needed? Would love to understand this, i am probably missing something! |
|
@haberbyte |
|
Ah, that makes sense, thank you! Unfortunate, that it is not even part of C++17 🤷♂ |
Fixes a misused
operator bool()plus usage of an undefined pointer in{GL,TexturePool}Holdercode.👀 @kkaefer @jfirebaugh
Fixes #5136.