[Xfc-dev] A little help

Ricardo M tareasrick at yahoo.com.mx
Thu May 4 17:49:01 CEST 2006


Here's the output in compile time with the delete[]
sentence:

ListSt.cc: In constructor `listStor::listStor(int)':
ListSt.cc:12: warning: deleting array `GType
types[((nCol - 1) + 1)]'

 --- Ricardo M <tareasrick at yahoo.com.mx> escribió:

> The backtrace is a print of the screen?
> Here it is:
> 
> bash-3.00# ./catalogos
> Segmentation fault
> bash-3.00# LOG:  unexpected EOF on client connection
> 
> The last line is coming from the DB
> 
>  --- Benedikt Meurer
> <benedikt.meurer at unix-ag.uni-siegen.de> escribió:
> 
> > Ricardo M wrote:
> > > Thank you!
> > > Here's my ListSt.hh code, the header of my new
> > > ListStore class:
> > > 
> > > #include <xfc/gtk/liststore.hh>
> > > 
> > > using namespace Xfc;
> > > 
> > > class listStor : public Gtk::ListStore
> > > {
> > >   int nColumnas;
> > > 
> > > public:
> > >   listStor (int nCols);
> > >   virtual ~listStor();
> > > };
> > > 
> > > 
> > > 
> > > And the body of the class in file ListStore.cc:
> > > 
> > > #include <xfc/gtk/liststore.hh>
> > > #include "ListSt.hh"
> > > 
> > > listStor::listStor (int nCol)
> > > {
> > >   nColumnas = nCol;
> > >   GType types[nCol];
> > > 
> > >   for (int n=0; n<nCol; ++n)
> > >     types[n] = G_TYPE_STRING;
> > >   set_column_types (nCol, types);
> > > }
> > 
> > Uhm, looks correct. Try allocating the types on
> the
> > heap instead:
> > 
> > GType *types = new GType[nCol];
> > for (int n = 0; n < nCol; ++n)
> >   types[n] = G_TYPE_STRING;
> > set_column_types (nCol, types);
> > delete[] types;
> > 
> > If that doesn't work, send a backtrace of the
> crash.
> > 
> > > Thank you
> > 
> > Benedikt
> > _______________________________________________
> > Xfc-dev mailing list
> > Xfc-dev at xfce.org
> > http://foo-projects.org/mailman/listinfo/xfc-dev
> > 
> 
> 
> 
> 	
> 	
> 		
>
___________________________________________________________
> 
> Do You Yahoo!? 
> La mejor conexión a Internet y <b >2GB</b> extra a
> tu correo por $100 al mes. http://net.yahoo.com.mx 
> 
> _______________________________________________
> Xfc-dev mailing list
> Xfc-dev at xfce.org
> http://foo-projects.org/mailman/listinfo/xfc-dev
> 


__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
Regístrate ya - http://correo.yahoo.com.mx/ 



More information about the Xfc-dev mailing list