Commit 2f926206 authored by Cyril Deguet's avatar Cyril Deguet

* fixed a segfault

parent 23b6ca2f
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk2_dragdrop.cpp: GTK2 implementation of the drag & drop * gtk2_dragdrop.cpp: GTK2 implementation of the drag & drop
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: gtk2_dragdrop.cpp,v 1.4 2003/04/19 11:16:17 asmax Exp $ * $Id: gtk2_dragdrop.cpp,v 1.5 2003/04/19 11:46:11 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@videolan.org> * Authors: Cyril Deguet <asmax@videolan.org>
* *
...@@ -66,13 +66,17 @@ void GTK2DropObject::HandleDropStart( GdkDragContext *context ) ...@@ -66,13 +66,17 @@ void GTK2DropObject::HandleDropStart( GdkDragContext *context )
for( int i = 0; i < len / sizeof(GdkAtom); i++ ) for( int i = 0; i < len / sizeof(GdkAtom); i++ )
{ {
GdkAtom atom = ( (GdkAtom*)buffer )[i]; GdkAtom atom = ( (GdkAtom*)buffer )[i];
string name = gdk_atom_name( atom ); gchar *name = gdk_atom_name( atom );
if( name == "text/plain" || name == "STRING" ) if( name )
{ {
target = name; string curTarget = name;
if( (curTarget == "text/plain" || curTarget == "STRING") )
{
target = curTarget;
break; break;
} }
} }
}
if( target == "" ) if( target == "" )
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk2_dragdrop.h: GTK2 implementation of the drag & drop * gtk2_dragdrop.h: GTK2 implementation of the drag & drop
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: gtk2_dragdrop.h,v 1.2 2003/04/19 11:16:17 asmax Exp $ * $Id: gtk2_dragdrop.h,v 1.3 2003/04/19 11:46:11 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@videolan.org> * Authors: Cyril Deguet <asmax@videolan.org>
* *
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
class GTK2DropObject class GTK2DropObject
{ {
private:
intf_thread_t *p_intf; intf_thread_t *p_intf;
public: public:
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk2_window.cpp: GTK2 implementation of the Window class * gtk2_window.cpp: GTK2 implementation of the Window class
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: gtk2_window.cpp,v 1.21 2003/04/19 11:16:17 asmax Exp $ * $Id: gtk2_window.cpp,v 1.22 2003/04/19 11:46:11 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@videolan.org> * Authors: Cyril Deguet <asmax@videolan.org>
* *
...@@ -106,7 +106,7 @@ GTK2Window::GTK2Window( intf_thread_t *p_intf, GdkWindow *gwnd, int x, int y, ...@@ -106,7 +106,7 @@ GTK2Window::GTK2Window( intf_thread_t *p_intf, GdkWindow *gwnd, int x, int y,
if( DragDrop ) if( DragDrop )
{ {
// register the listview as a drop target // register the listview as a drop target
GTK2DropObject *DropDrop = new GTK2DropObject( p_intf ); DropObject = new GTK2DropObject( p_intf );
gdk_window_register_dnd( gwnd ); gdk_window_register_dnd( gwnd );
} }
......
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