loplugin:useuniqueptr in bridges
Change-Id: I7bf75ffafa63ec88e89192ed32880675c9ae1d61 Reviewed-on: https://gerrit.libreoffice.org/52883 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
@@ -61,7 +61,7 @@ void JNI_interface_type_info::destroy( JNIEnv * jni_env )
|
|||||||
JNI_type_info::destruct( jni_env );
|
JNI_type_info::destruct( jni_env );
|
||||||
jni_env->DeleteGlobalRef( m_proxy_ctor );
|
jni_env->DeleteGlobalRef( m_proxy_ctor );
|
||||||
jni_env->DeleteGlobalRef( m_type );
|
jni_env->DeleteGlobalRef( m_type );
|
||||||
delete [] m_methods;
|
m_methods.reset();
|
||||||
delete this;
|
delete this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,7 +104,7 @@ JNI_interface_type_info::JNI_interface_type_info(
|
|||||||
reinterpret_cast< typelib_InterfaceTypeDescription * >(
|
reinterpret_cast< typelib_InterfaceTypeDescription * >(
|
||||||
m_td.get() );
|
m_td.get() );
|
||||||
// coverity [ctor_dtor_leak]
|
// coverity [ctor_dtor_leak]
|
||||||
m_methods = new jmethodID[ td->nMapFunctionIndexToMemberIndex ];
|
m_methods.reset(new jmethodID[ td->nMapFunctionIndexToMemberIndex ]);
|
||||||
sal_Int32 nMethodIndex = 0;
|
sal_Int32 nMethodIndex = 0;
|
||||||
typelib_TypeDescriptionReference ** ppMembers = td->ppMembers;
|
typelib_TypeDescriptionReference ** ppMembers = td->ppMembers;
|
||||||
sal_Int32 nMembers = td->nMembers;
|
sal_Int32 nMembers = td->nMembers;
|
||||||
@@ -211,7 +211,7 @@ JNI_interface_type_info::JNI_interface_type_info(
|
|||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
delete [] m_methods;
|
m_methods.reset();
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -224,7 +224,7 @@ JNI_interface_type_info::JNI_interface_type_info(
|
|||||||
void JNI_compound_type_info::destroy( JNIEnv * jni_env )
|
void JNI_compound_type_info::destroy( JNIEnv * jni_env )
|
||||||
{
|
{
|
||||||
JNI_type_info::destruct( jni_env );
|
JNI_type_info::destruct( jni_env );
|
||||||
delete [] m_fields;
|
m_fields.reset();
|
||||||
delete this;
|
delete this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -289,7 +289,7 @@ JNI_compound_type_info::JNI_compound_type_info(
|
|||||||
jni_info->m_RuntimeException_type.getTypeLibType() ))
|
jni_info->m_RuntimeException_type.getTypeLibType() ))
|
||||||
{
|
{
|
||||||
// coverity [ctor_dtor_leak]
|
// coverity [ctor_dtor_leak]
|
||||||
m_fields = new jfieldID[ 2 ];
|
m_fields.reset(new jfieldID[ 2 ]);
|
||||||
m_fields[ 0 ] = nullptr; // special Throwable.getMessage()
|
m_fields[ 0 ] = nullptr; // special Throwable.getMessage()
|
||||||
// field Context
|
// field Context
|
||||||
m_fields[ 1 ] = jni->GetFieldID(
|
m_fields[ 1 ] = jni->GetFieldID(
|
||||||
@@ -301,7 +301,7 @@ JNI_compound_type_info::JNI_compound_type_info(
|
|||||||
{
|
{
|
||||||
// retrieve field ids for all direct members
|
// retrieve field ids for all direct members
|
||||||
sal_Int32 nMembers = td->nMembers;
|
sal_Int32 nMembers = td->nMembers;
|
||||||
m_fields = new jfieldID[ nMembers ];
|
m_fields.reset(new jfieldID[ nMembers ]);
|
||||||
|
|
||||||
for ( sal_Int32 nPos = 0; nPos < nMembers; ++nPos )
|
for ( sal_Int32 nPos = 0; nPos < nMembers; ++nPos )
|
||||||
{
|
{
|
||||||
@@ -334,7 +334,7 @@ JNI_compound_type_info::JNI_compound_type_info(
|
|||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
delete [] m_fields;
|
m_fields.reset();
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -82,7 +82,7 @@ struct JNI_interface_type_info : public JNI_type_info
|
|||||||
jobject m_proxy_ctor; // proxy ctor
|
jobject m_proxy_ctor; // proxy ctor
|
||||||
jobject m_type;
|
jobject m_type;
|
||||||
// sorted via typelib function index
|
// sorted via typelib function index
|
||||||
jmethodID * m_methods;
|
std::unique_ptr<jmethodID[]> m_methods;
|
||||||
|
|
||||||
virtual void destroy( JNIEnv * jni_env ) override;
|
virtual void destroy( JNIEnv * jni_env ) override;
|
||||||
explicit JNI_interface_type_info(
|
explicit JNI_interface_type_info(
|
||||||
@@ -98,7 +98,7 @@ struct JNI_compound_type_info : public JNI_type_info
|
|||||||
// ctor( msg ) for exceptions
|
// ctor( msg ) for exceptions
|
||||||
jmethodID m_exc_ctor;
|
jmethodID m_exc_ctor;
|
||||||
// sorted via typelib member index
|
// sorted via typelib member index
|
||||||
jfieldID * m_fields;
|
std::unique_ptr<jfieldID[]> m_fields;
|
||||||
|
|
||||||
virtual void destroy( JNIEnv * jni_env ) override;
|
virtual void destroy( JNIEnv * jni_env ) override;
|
||||||
explicit JNI_compound_type_info(
|
explicit JNI_compound_type_info(
|
||||||
|
Reference in New Issue
Block a user