case REMOVE:
if (!g_queue_is_empty (q))
g_queue_remove (q, qinf->tail->data);
+ /* qinf->head/qinf->tail may be invalid at this point */
if (!g_queue_is_empty (q))
- g_queue_remove (q, qinf->head->data);
+ g_queue_remove (q, q->head->data);
if (!g_queue_is_empty (q))
g_queue_remove (q, g_queue_peek_nth (q, get_random_position (q, TRUE)));
case REMOVE_ALL:
if (!g_queue_is_empty (q))
g_queue_remove_all (q, qinf->tail->data);
+ /* qinf->head/qinf->tail may be invalid at this point */
if (!g_queue_is_empty (q))
- g_queue_remove_all (q, qinf->head->data);
+ g_queue_remove_all (q, q->head->data);
if (!g_queue_is_empty (q))
g_queue_remove_all (q, g_queue_peek_nth (q, get_random_position (q, TRUE)));
g_queue_insert_before (q, qinf->tail, x);
g_queue_insert_before (q, qinf->head, x);
g_queue_insert_before (q, g_queue_find (q, x), x);
+ g_queue_insert_before (q, NULL, x);
}
qinf->head = q->head;
qinf->tail = q->tail;
g_queue_insert_after (q, qinf->tail, x);
g_queue_insert_after (q, qinf->head, x);
g_queue_insert_after (q, g_queue_find (q, x), x);
+ g_queue_insert_after (q, NULL, x);
}
qinf->head = q->head;
qinf->tail = q->tail;