From bc229dbfabdf6a59453605e7652f04a268605b3a Mon Sep 17 00:00:00 2001 From: deva Date: Fri, 13 Aug 2010 07:58:49 +0000 Subject: Memory cleanup bug, fixed. --- client/netcom.cc | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'client/netcom.cc') diff --git a/client/netcom.cc b/client/netcom.cc index 9056ec3..a606c62 100644 --- a/client/netcom.cc +++ b/client/netcom.cc @@ -48,8 +48,8 @@ #endif #endif -//#define DEBUG(fmt...) printf(fmt) -#define DEBUG(ftm...) +#define DEBUG(fmt...) printf(fmt) +//#define DEBUG(ftm...) NetCom::NetCom(QString host, quint16 port) { @@ -192,15 +192,17 @@ QDomDocument NetCom::send(QVector< Widget* > widgets, QString templ, // the commit string QVector< Widget* >::iterator i = widgets.begin(); while (i != widgets.end()) { - Widget* w = *i; - - if(w->enabled() && w->name() != "" && w->local() == false) { - QDomElement field_elem = doc.createElement("field"); - field_elem.setAttribute("name", w->name()); - field_elem.setAttribute("value", w->value()); - commit_elem.appendChild(field_elem); + if(*i) { + Widget* w = *i; + DEBUG("W: %s: %s\n", w->name().toStdString().c_str(), + w->value().toStdString().c_str()); + if(w->enabled() && w->name() != "" && w->local() == false) { + QDomElement field_elem = doc.createElement("field"); + field_elem.setAttribute("name", w->name()); + field_elem.setAttribute("value", w->value()); + commit_elem.appendChild(field_elem); + } } - i++; } -- cgit v1.2.3