summaryrefslogtreecommitdiffstats
path: root/profile-widget/diveeventitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'profile-widget/diveeventitem.cpp')
-rw-r--r--profile-widget/diveeventitem.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/profile-widget/diveeventitem.cpp b/profile-widget/diveeventitem.cpp
index 0bbc84267..083c8b5b8 100644
--- a/profile-widget/diveeventitem.cpp
+++ b/profile-widget/diveeventitem.cpp
@@ -19,6 +19,10 @@ DiveEventItem::DiveEventItem(QObject *parent) : DivePixmapItem(parent),
setFlag(ItemIgnoresTransformations);
}
+DiveEventItem::~DiveEventItem()
+{
+ free(internalEvent);
+}
void DiveEventItem::setHorizontalAxis(DiveCartesianAxis *axis)
{
@@ -48,7 +52,9 @@ void DiveEventItem::setEvent(struct event *ev)
{
if (!ev)
return;
- internalEvent = ev;
+
+ free(internalEvent);
+ internalEvent = clone_event(ev);
setupPixmap();
setupToolTipString();
recalculatePos(true);