making -fanalyzer happy
This commit is contained in:
parent
cb43ac7dee
commit
3f416c21f9
|
@ -120,6 +120,8 @@ pedantic {
|
||||||
QMAKE_CXXFLAGS *= -Wsuggest-override
|
QMAKE_CXXFLAGS *= -Wsuggest-override
|
||||||
# QMAKE_CXXFLAGS *= -Wsuggest-final-types
|
# QMAKE_CXXFLAGS *= -Wsuggest-final-types
|
||||||
# QMAKE_CXXFLAGS *= -Wsuggest-final-methods
|
# QMAKE_CXXFLAGS *= -Wsuggest-final-methods
|
||||||
|
|
||||||
|
# QMAKE_CXXFLAGS *= -fanalyzer
|
||||||
}
|
}
|
||||||
|
|
||||||
linux-clang {
|
linux-clang {
|
||||||
|
|
|
@ -200,11 +200,11 @@ void QskMetaFunction::invoke( QObject* object,
|
||||||
|
|
||||||
// code is not thread safe - TODO ...
|
// code is not thread safe - TODO ...
|
||||||
|
|
||||||
QPointer< QObject > receiver( object );
|
|
||||||
|
|
||||||
if ( m_functionCall == nullptr )
|
if ( m_functionCall == nullptr )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
QPointer< QObject > receiver( object );
|
||||||
|
|
||||||
int invokeType = connectionType & 0x3;
|
int invokeType = connectionType & 0x3;
|
||||||
|
|
||||||
if ( invokeType == Qt::AutoConnection )
|
if ( invokeType == Qt::AutoConnection )
|
||||||
|
@ -247,8 +247,16 @@ void QskMetaFunction::invoke( QObject* object,
|
||||||
|
|
||||||
const auto argc = parameterCount() + 1; // return value + arguments
|
const auto argc = parameterCount() + 1; // return value + arguments
|
||||||
|
|
||||||
auto types = static_cast< int* >( malloc( argc * sizeof( int ) ) );
|
auto types = static_cast< int* >( std::malloc( argc * sizeof( int ) ) );
|
||||||
auto arguments = static_cast< void** >( malloc( argc * sizeof( void* ) ) );
|
auto arguments = static_cast< void** >( std::malloc( argc * sizeof( void* ) ) );
|
||||||
|
|
||||||
|
if ( types == nullptr || arguments == nullptr )
|
||||||
|
{
|
||||||
|
std::free( types );
|
||||||
|
std::free( arguments );
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
types[ 0 ] = QMetaType::UnknownType;
|
types[ 0 ] = QMetaType::UnknownType;
|
||||||
arguments[ 0 ] = nullptr;
|
arguments[ 0 ] = nullptr;
|
||||||
|
@ -270,8 +278,8 @@ void QskMetaFunction::invoke( QObject* object,
|
||||||
if ( receiver.isNull() )
|
if ( receiver.isNull() )
|
||||||
{
|
{
|
||||||
// object might have died in the meantime
|
// object might have died in the meantime
|
||||||
free( types );
|
std::free( types );
|
||||||
free( arguments );
|
std::free( arguments );
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue