Used std::exchange for a thing
Note we don't really need to set the other object's renderer ptr to null since the canvas dtor doesn't destroy it anymore, but still. Good to do.
This commit is contained in:
parent
1167e3e78b
commit
68f4bd14d6
1 changed files with 1 additions and 3 deletions
|
@ -1375,15 +1375,13 @@ canvas::canvas(canvas&& c)
|
|||
, w_(c.w_)
|
||||
, h_(c.h_)
|
||||
, texture_(std::move(c.texture_))
|
||||
, renderer_(c.renderer_)
|
||||
, renderer_(std::exchange(c.renderer_, nullptr))
|
||||
, variables_(c.variables_)
|
||||
, functions_(c.functions_)
|
||||
, is_dirty_(c.is_dirty_)
|
||||
, size_changed_(c.size_changed_)
|
||||
, cache_invalidated_(c.cache_invalidated_)
|
||||
{
|
||||
// Needed to ensure the other object doesn't destroy our software renderer prematurely.
|
||||
c.renderer_ = nullptr;
|
||||
}
|
||||
|
||||
canvas::~canvas()
|
||||
|
|
Loading…
Add table
Reference in a new issue