projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6e7c61c
)
Cleanup: use ScopeGuard.
author
Carl Hetherington
<cth@carlh.net>
Sun, 5 Feb 2023 12:50:26 +0000
(13:50 +0100)
committer
Carl Hetherington
<cth@carlh.net>
Sun, 5 Feb 2023 12:50:26 +0000
(13:50 +0100)
src/wx/timeline.cc
patch
|
blob
|
history
diff --git
a/src/wx/timeline.cc
b/src/wx/timeline.cc
index 2a8555e7ce0b3fd8abcedd14dc369e2c7e43712d..604a00f39cd60ed482719c789af534c11bc2aadc 100644
(file)
--- a/
src/wx/timeline.cc
+++ b/
src/wx/timeline.cc
@@
-35,6
+35,7
@@
#include "lib/film.h"
#include "lib/image_content.h"
#include "lib/playlist.h"
#include "lib/film.h"
#include "lib/image_content.h"
#include "lib/playlist.h"
+#include "lib/scope_guard.h"
#include "lib/text_content.h"
#include "lib/timer.h"
#include "lib/video_content.h"
#include "lib/text_content.h"
#include "lib/timer.h"
#include "lib/video_content.h"
@@
-155,13
+156,13
@@
Timeline::paint_labels ()
return;
}
return;
}
+ ScopeGuard sg = [gc]() { delete gc; };
+
int vsx, vsy;
_labels_canvas->GetViewStart (&vsx, &vsy);
gc->Translate (-vsx * _x_scroll_rate, -vsy * _y_scroll_rate + tracks_y_offset());
_labels_view->paint (gc, {});
int vsx, vsy;
_labels_canvas->GetViewStart (&vsx, &vsy);
gc->Translate (-vsx * _x_scroll_rate, -vsy * _y_scroll_rate + tracks_y_offset());
_labels_view->paint (gc, {});
-
- delete gc;
}
}
@@
-176,6
+177,8
@@
Timeline::paint_main ()
return;
}
return;
}
+ ScopeGuard sg = [gc]() { delete gc; };
+
int vsx, vsy;
_main_canvas->GetViewStart (&vsx, &vsy);
gc->Translate (-vsx * _x_scroll_rate, -vsy * _y_scroll_rate);
int vsx, vsy;
_main_canvas->GetViewStart (&vsx, &vsy);
gc->Translate (-vsx * _x_scroll_rate, -vsy * _y_scroll_rate);
@@
-225,8
+228,6
@@
Timeline::paint_main ()
path.MoveToPoint (ph, 0);
path.AddLineToPoint (ph, pixels_per_track() * _tracks + 32);
gc->StrokePath (path);
path.MoveToPoint (ph, 0);
path.AddLineToPoint (ph, pixels_per_track() * _tracks + 32);
gc->StrokePath (path);
-
- delete gc;
}
}