Jelajahi Sumber

qdevice: Allow delete timer withing it's callback

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Jan Friesse 10 tahun lalu
induk
melakukan
327eaf10c3
2 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 1 1
      qdevices/qnetd-instance.c
  2. 1 1
      qdevices/timer-list.c

+ 1 - 1
qdevices/qnetd-instance.c

@@ -72,7 +72,6 @@ qnetd_instance_destroy(struct qnetd_instance *instance)
 	struct qnetd_client *client;
 	struct qnetd_client *client_next;
 
-	timer_list_free(&instance->main_timer_list);
 
 	client = TAILQ_FIRST(&instance->clients);
 	while (client != NULL) {
@@ -86,6 +85,7 @@ qnetd_instance_destroy(struct qnetd_instance *instance)
 	qnetd_poll_array_destroy(&instance->poll_array);
 	qnetd_cluster_list_free(&instance->clusters);
 	qnetd_client_list_free(&instance->clients);
+	timer_list_free(&instance->main_timer_list);
 
 	return (0);
 }

+ 1 - 1
qdevices/timer-list.c

@@ -168,7 +168,7 @@ timer_list_expire(struct timer_list *tlist)
 			 * Move item to free list
 			 */
 			timer_list_delete(tlist, entry);
-		} else {
+		} else if (entry->is_active) {
 			/*
 			 * Schedule again
 			 */