Merge "media: Silence an analyzer complaint; clean up code"
This commit is contained in:
committed by
Android (Google) Code Review
commit
970e89459e
@@ -135,7 +135,7 @@ JNIAudioAttributeHelper::UniqueAaPtr JNIAudioAttributeHelper::makeUnique()
|
||||
{
|
||||
audio_attributes_t *aa = new (calloc(1, sizeof(audio_attributes_t)))
|
||||
audio_attributes_t{AUDIO_ATTRIBUTES_INITIALIZER};
|
||||
return UniqueAaPtr{aa, free};
|
||||
return UniqueAaPtr{aa};
|
||||
}
|
||||
|
||||
jint JNIAudioAttributeHelper::nativeFromJava(JNIEnv* env, jobject jAudioAttributes,
|
||||
|
||||
@@ -27,7 +27,11 @@ namespace android {
|
||||
class JNIAudioAttributeHelper
|
||||
{
|
||||
public:
|
||||
using UniqueAaPtr = std::unique_ptr<audio_attributes_t, decltype(free)*>;
|
||||
struct FreeDeleter {
|
||||
void operator()(void *p) const { ::free(p); }
|
||||
};
|
||||
|
||||
using UniqueAaPtr = std::unique_ptr<audio_attributes_t, FreeDeleter>;
|
||||
|
||||
/**
|
||||
* @brief makeUnique helper to prevent leak
|
||||
|
||||
Reference in New Issue
Block a user