mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-30 06:32:42 +00:00
Use UniquePtr<Dirty> instead of naked new/delete operations.
This commit is contained in:
parent
d55e4c58e4
commit
1dcb42a10a
@ -23,6 +23,7 @@
|
||||
#include "app.h"
|
||||
#include "app/color.h"
|
||||
#include "app/color_utils.h"
|
||||
#include "base/unique_ptr.h"
|
||||
#include "context.h"
|
||||
#include "gui/gui.h"
|
||||
#include "modules/editors.h"
|
||||
@ -267,15 +268,12 @@ public:
|
||||
else {
|
||||
// Undo the dirty region.
|
||||
if (undo->isEnabled()) {
|
||||
Dirty* dirty = new Dirty(m_cel_image, m_dst_image);
|
||||
// TODO error handling
|
||||
UniquePtr<Dirty> dirty(new Dirty(m_cel_image, m_dst_image));
|
||||
|
||||
dirty->saveImagePixels(m_cel_image);
|
||||
if (dirty != NULL)
|
||||
undo->pushUndoer(new undoers::DirtyArea(undo->getObjects(),
|
||||
m_cel_image, dirty));
|
||||
|
||||
delete dirty;
|
||||
m_cel_image, dirty));
|
||||
}
|
||||
|
||||
// Copy the 'dst_image' to the cel_image.
|
||||
|
Loading…
x
Reference in New Issue
Block a user