Browse Source

delete lane button widgets as part of lane free instead of track widget destroy

Fixes segfault on close
gtk4
parent
commit
7f64601afd
Signed by: alex
GPG Key ID: 022EAE42313D70F3
  1. 9
      src/audio/track_lane.c
  2. 10
      src/gui/widgets/track.c

9
src/audio/track_lane.c

@ -26,6 +26,7 @@ @@ -26,6 +26,7 @@
#include "gui/backend/event.h"
#include "gui/backend/event_manager.h"
#include "gui/widgets/arranger.h"
#include "gui/widgets/custom_button.h"
#include "midilib/src/midifile.h"
#include "midilib/src/midiinfo.h"
#include "project.h"
@ -467,5 +468,13 @@ track_lane_free ( @@ -467,5 +468,13 @@ track_lane_free (
object_zero_and_free_if_nonnull (self->regions);
/* FIXME this is bad design - this object should
* not care about widgets */
for (int j = 0; j < self->num_buttons; j++)
{
if (self->buttons[j])
custom_button_widget_free (self->buttons[j]);
}
object_zero_and_free (self);
}

10
src/gui/widgets/track.c

@ -3101,16 +3101,6 @@ on_destroy ( @@ -3101,16 +3101,6 @@ on_destroy (
custom_button_widget_free (cb);
}
for (int i = 0; i < track->num_lanes; i++)
{
TrackLane * lane = track->lanes[i];
for (int j = 0; j < lane->num_buttons; j++)
{
cb = lane->buttons[j];
custom_button_widget_free (cb);
}
}
track->widget = NULL;
}

Loading…
Cancel
Save