Commit 41c3dd9b authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Qt4: never assign qtu() to a variable

As far as I understand, this breaks C++ object scoping. qtu() creates
a temporary anonymous QByteArray from its QString parameter. That array
is destroyed at the end of the expression, thus the return value of
qtu() becomes a dangling pointer.
parent 20dc6ced
......@@ -854,9 +854,8 @@ void PLModel::search( const QString& search_text, const QModelIndex & idx, bool
playlist_item_t *p_root = playlist_ItemGetById( p_playlist,
itemId( idx ) );
assert( p_root );
const char *psz_name = qtu( search_text );
playlist_LiveSearchUpdate( p_playlist , p_root, psz_name, b_recursive );
playlist_LiveSearchUpdate( p_playlist , p_root, qtu( search_text ),
b_recursive );
if( idx.isValid() )
{
PLItem *searchRoot = getItem( idx );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment