diff --git a/modules/module-pw-alsa-udev.c b/modules/module-pw-alsa-udev.c
index 6c499495664c440d18f4d85ed5f756c179552f21..534776e7250ff0b8a32e97425ed0b531e0f86545 100644
--- a/modules/module-pw-alsa-udev.c
+++ b/modules/module-pw-alsa-udev.c
@@ -415,12 +415,18 @@ update_device(struct impl *impl, struct device *dev,
 static void
 destroy_device(struct impl *impl, struct device *dev)
 {
+  struct node *node;
+
   /* Remove the device from the list */
   spa_list_remove(&dev->link);
 
   /* Remove the device listener */
   spa_hook_remove(&dev->device_listener);
 
+  /* Destry all the nodes that the device has */
+  spa_list_consume(node, &dev->node_list, link)
+    destroy_node(impl, dev, node);
+
   /* Destroy the device proxy */
   pw_proxy_destroy(dev->proxy);
 
diff --git a/modules/module-pw-bluez.c b/modules/module-pw-bluez.c
index e1392dd11504cf77756361a5cbe6cc47b0afbd54..754b7f935d0c81f5b785480acb213e6d50926dc9 100644
--- a/modules/module-pw-bluez.c
+++ b/modules/module-pw-bluez.c
@@ -445,12 +445,18 @@ update_device(struct impl *impl, struct device *dev,
 static void
 destroy_device(struct impl *impl, struct device *dev)
 {
+  struct node *node;
+
   /* Remove the device from the list */
   spa_list_remove(&dev->link);
 
   /* Remove the device listener */
   spa_hook_remove(&dev->device_listener);
 
+  /* Destry all the nodes that the device has */
+  spa_list_consume(node, &dev->node_list, link)
+    destroy_node(impl, dev, node);
+
   /* Destroy the device proxy */
   pw_proxy_destroy(dev->proxy);