Commit 0259254c 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.
(cherry picked from commit 41c3dd9b229c44cb313786f96cc2089a9d5197cc)
parent 44e61560
...@@ -883,9 +883,8 @@ void PLModel::search( const QString& search_text, const QModelIndex & idx, bool ...@@ -883,9 +883,8 @@ void PLModel::search( const QString& search_text, const QModelIndex & idx, bool
playlist_item_t *p_root = playlist_ItemGetById( p_playlist, playlist_item_t *p_root = playlist_ItemGetById( p_playlist,
itemId( idx ) ); itemId( idx ) );
assert( p_root ); assert( p_root );
const char *psz_name = qtu( search_text ); playlist_LiveSearchUpdate( p_playlist , p_root, qtu( search_text ),
playlist_LiveSearchUpdate( p_playlist , p_root, psz_name, b_recursive ); b_recursive );
if( idx.isValid() ) if( idx.isValid() )
{ {
PLItem *searchRoot = getItem( idx ); 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