Fix: Compositor retains old images
The compositor does not correctly free, wrap, or allocate images. That's because the resetting mechanism didn't reset all members. This patch rests all members and only retains the important ones.
This commit is contained in:
parent
a02b429324
commit
df9b3d35a2
|
@ -275,11 +275,10 @@ class Result {
|
|||
void set_initial_reference_count(int count);
|
||||
|
||||
/* Reset the result to prepare it for a new evaluation. This should be called before evaluating
|
||||
* the operation that computes this result. First, set the value of reference_count_ to the value
|
||||
* of initial_reference_count_ since reference_count_ may have already been decremented to zero
|
||||
* in a previous evaluation. Second, set master_ to nullptr because the result may have been
|
||||
* turned into a proxy result in a previous evaluation. Other fields don't need to be reset
|
||||
* because they are runtime and overwritten during evaluation. */
|
||||
* the operation that computes this result. Keep the type, precision, texture pool, and initial
|
||||
* reference count, and rest all other members to their default value. Finally, set the value of
|
||||
* reference_count_ to the value of initial_reference_count_ since reference_count_ may have
|
||||
* already been decremented to zero in a previous evaluation. */
|
||||
void reset();
|
||||
|
||||
/* Increment the reference count of the result by the given count. If this result have a master
|
||||
|
|
|
@ -389,8 +389,10 @@ void Result::set_initial_reference_count(int count)
|
|||
|
||||
void Result::reset()
|
||||
{
|
||||
master_ = nullptr;
|
||||
reference_count_ = initial_reference_count_;
|
||||
const int initial_reference_count = initial_reference_count_;
|
||||
*this = Result(type_, *texture_pool_, precision_);
|
||||
initial_reference_count_ = initial_reference_count;
|
||||
reference_count_ = initial_reference_count;
|
||||
}
|
||||
|
||||
void Result::increment_reference_count(int count)
|
||||
|
|
Loading…
Reference in New Issue