Merge branch 'master' into blender2.8
[blender.git] / source / blender / makesrna / intern / rna_userdef.c
index 986a85588ffc7726ccb1b237aa5f4910cfa6c121..438735d371d95e0388b218d80f75492d448725bb 100644 (file)
@@ -609,9 +609,9 @@ static void rna_AddonPref_unregister(Main *UNUSED(bmain), StructRNA *type)
                return;
 
        RNA_struct_free_extension(type, &apt->ext);
+       RNA_struct_free(&BLENDER_RNA, type);
 
        BKE_addon_pref_type_remove(apt);
-       RNA_struct_free(&BLENDER_RNA, type);
 
        /* update while blender is running */
        WM_main_add_notifier(NC_WINDOW, NULL);