1
0
forked from drath/libratbag

Skip the manual NULL assignment after unref

libratbag guarantees that unref() always returns NULL

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer
2016-03-10 13:03:56 +10:00
parent 8517e103b0
commit 346631cd75
3 changed files with 3 additions and 12 deletions

View File

@@ -557,10 +557,7 @@ struct ratbagd_button *ratbagd_button_free(struct ratbagd_button *button)
return NULL;
button->path = mfree(button->path);
/* we cannot assume the button is gone, so set NULL explicitly */
ratbag_button_unref(button->lib_button);
button->lib_button = NULL;
button->lib_button = ratbag_button_unref(button->lib_button);
return mfree(button);
}

View File

@@ -381,10 +381,7 @@ struct ratbagd_profile *ratbagd_profile_free(struct ratbagd_profile *profile)
mfree(profile->resolutions);
profile->path = mfree(profile->path);
/* we cannot assume the profile is gone, so set NULL explicitly */
ratbag_profile_unref(profile->lib_profile);
profile->lib_profile = NULL;
profile->lib_profile = ratbag_profile_unref(profile->lib_profile);
return mfree(profile);
}

View File

@@ -166,10 +166,7 @@ struct ratbagd_resolution *ratbagd_resolution_free(struct ratbagd_resolution *re
return NULL;
resolution->path = mfree(resolution->path);
/* we cannot assume the resolution is gone, so set NULL explicitly */
ratbag_resolution_unref(resolution->lib_resolution);
resolution->lib_resolution = NULL;
resolution->lib_resolution = ratbag_resolution_unref(resolution->lib_resolution);
return mfree(resolution);
}