core: mark as managed-type=removed when unrealize

This is needed to ensure that the right CleanupType is chosen when
calling to nm_device_state_changed() a bit later. With this change
CLEANUP_TYPE_REMOVED will be used instead of CLEANUP_TYPE_DECONFIGURE,
which is wrong because the device has already disappeared.
This commit is contained in:
Íñigo Huguet 2025-10-22 13:23:37 +02:00
parent 32cbf4c629
commit e06aaba1ca

View file

@ -8678,6 +8678,8 @@ nm_device_unrealize(NMDevice *self, gboolean remove_resources, GError **error)
g_object_thaw_notify(G_OBJECT(self)); g_object_thaw_notify(G_OBJECT(self));
nm_device_managed_type_set(self, NM_DEVICE_MANAGED_TYPE_REMOVED);
nm_device_set_unmanaged_flags(self, NM_UNMANAGED_PLATFORM_INIT, TRUE); nm_device_set_unmanaged_flags(self, NM_UNMANAGED_PLATFORM_INIT, TRUE);
nm_device_set_unmanaged_flags(self, nm_device_set_unmanaged_flags(self,