g_queue_push_head (&cluster->edges, p2tr_edge_ref (E));
- current = E;
+ current = p2tr_edge_ref (E);
next = p2tr_point_edge_cw (P, current);
while (next != g_queue_peek_head (&cluster->edges)
&& p2tr_cluster_cw_tri_between_is_in_domain (current, next))
{
g_queue_push_tail (&cluster->edges, p2tr_edge_ref (next));
+ p2tr_edge_unref (current);
current = next;
next = p2tr_point_edge_cw (P, current);
cluster->min_angle = MIN (cluster->min_angle, temp_angle);
}
+ p2tr_edge_unref (current);
+ p2tr_edge_unref (next);
- current = E;
+ current = p2tr_edge_ref (E);
next = p2tr_point_edge_ccw(P, current);
+ p2tr_edge_unref(next);
while (next != g_queue_peek_tail (&cluster->edges)
&& (temp_angle = p2tr_edge_angle_between (current->mirror, next)) <= P2TR_CLUSTER_LIMIT_ANGLE
&& p2tr_cluster_cw_tri_between_is_in_domain (next, current))
{
g_queue_push_head (&cluster->edges, p2tr_edge_ref (next));
+ p2tr_edge_unref (current);
current = next;
next = p2tr_point_edge_ccw (P, current);
cluster->min_angle = MIN(cluster->min_angle, temp_angle);
}
+ p2tr_edge_unref (current);
+ p2tr_edge_unref (next);
return cluster;
}
g_assert (self->record_undo);
+ self->record_undo = FALSE;
+
for (iter = self->undo.head; iter != NULL; iter = iter->next)
p2tr_mesh_action_unref ((P2trMeshAction*)iter->data);
g_queue_clear (&self->undo);
-
- self->record_undo = FALSE;
}
void
g_assert (self->record_undo);
+ /* Set the record_undo flag to FALSE before p2tr_mesh_action_undo, so that
+ * we don't create zombie objects therein. */
+ self->record_undo = FALSE;
+
for (iter = self->undo.tail; iter != NULL; iter = iter->prev)
{
p2tr_mesh_action_undo ((P2trMeshAction*)iter->data, self);
p2tr_mesh_action_unref ((P2trMeshAction*)iter->data);
}
g_queue_clear (&self->undo);
-
- self->record_undo = FALSE;
}
void