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

* fixed a segfault

parent 23b6ca2f
......@@ -2,7 +2,7 @@
* gtk2_dragdrop.cpp: GTK2 implementation of the drag & drop
*****************************************************************************
* 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>
*
......@@ -66,11 +66,15 @@ void GTK2DropObject::HandleDropStart( GdkDragContext *context )
for( int i = 0; i < len / sizeof(GdkAtom); i++ )
{
GdkAtom atom = ( (GdkAtom*)buffer )[i];
string name = gdk_atom_name( atom );
if( name == "text/plain" || name == "STRING" )
gchar *name = gdk_atom_name( atom );
if( name )
{
target = name;
break;
string curTarget = name;
if( (curTarget == "text/plain" || curTarget == "STRING") )
{
target = curTarget;
break;
}
}
}
......
......@@ -2,7 +2,7 @@
* gtk2_dragdrop.h: GTK2 implementation of the drag & drop
*****************************************************************************
* 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>
*
......@@ -34,8 +34,8 @@
//---------------------------------------------------------------------------
class GTK2DropObject
{
intf_thread_t *p_intf;
private:
intf_thread_t *p_intf;
public:
GTK2DropObject( intf_thread_t *_p_intf );
......
......@@ -2,7 +2,7 @@
* gtk2_window.cpp: GTK2 implementation of the Window class
*****************************************************************************
* 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>
*
......@@ -106,7 +106,7 @@ GTK2Window::GTK2Window( intf_thread_t *p_intf, GdkWindow *gwnd, int x, int y,
if( DragDrop )
{
// register the listview as a drop target
GTK2DropObject *DropDrop = new GTK2DropObject( p_intf );
DropObject = new GTK2DropObject( p_intf );
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