CList memory management with C++ ...
- From: John Schmerge <schmerge cyber com>
- To: gtk-app-devel-list gnome org
- Subject: CList memory management with C++ ...
- Date: Wed, 20 Dec 2000 12:52:06 -0500
When one calls gtk_clist_append(GtkCList * , gchar * text [])
does the clist performs a deep copy of the data in text, or does it just
maintain references to the data in the original array?
My purpose for asking is to determine if the following piece of C++ w/ gtk will
work correctly and won't cause any black-magic voodoo-style bugs down the road:
myClist = gtk_clist_new(1);
for (std::list<std::string>::iterator i = l.begin; i != l.end(); ++i)
{
char * ptr = i->c_str(); // <- this is the piece that I'm worried about...
gtk_clist_append(GTK_CLIST(myClist), &ptr);
}
Thanks in advance,
John Schmerge
---------------------------
John Schmerge
schmerge cyber com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]