diff options
author | deva <deva> | 2010-08-13 07:58:49 +0000 |
---|---|---|
committer | deva <deva> | 2010-08-13 07:58:49 +0000 |
commit | bc229dbfabdf6a59453605e7652f04a268605b3a (patch) | |
tree | 949c083efc8a06e1b55fa9440cc100d2b235215d /client/netcom.cc | |
parent | d9338083192084613e5530b02710b796252d342b (diff) |
Memory cleanup bug, fixed.
Diffstat (limited to 'client/netcom.cc')
-rw-r--r-- | client/netcom.cc | 22 |
1 files changed, 12 insertions, 10 deletions
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++; } |