mirror of
https://git.code.sf.net/p/fldigi/flrig
synced 2026-08-13 17:28:24 -04:00
Memory leaks
* fix memory leaks in xmlrpc interface code * fix memory leaks in xcvr_setup code
This commit is contained in:
parent
ed67969510
commit
3c2ee3ae51
2 changed files with 7 additions and 17 deletions
|
|
@ -2027,24 +2027,12 @@ Fl_Group *createRestore(int X, int Y, int W, int H, const char *label)
|
|||
|
||||
#include <vector>
|
||||
|
||||
struct CONFIG_PAGE {
|
||||
Fl_Group *grp;
|
||||
std::string label;
|
||||
CONFIG_PAGE( Fl_Group *_grp = 0, std::string _lbl = "") {
|
||||
grp = _grp;
|
||||
label = _lbl;
|
||||
}
|
||||
~CONFIG_PAGE() {
|
||||
if (grp) delete grp; }
|
||||
};
|
||||
|
||||
std::vector<CONFIG_PAGE *> config_pages;
|
||||
std::vector< Fl_Group* > config_pages;
|
||||
static Fl_Group *current = 0;
|
||||
Fl_Tree *tab_tree;
|
||||
|
||||
void add_tree_item(Fl_Group *g) {
|
||||
CONFIG_PAGE *p1 = new CONFIG_PAGE(g, g->label());
|
||||
config_pages.push_back(p1);
|
||||
config_pages.push_back(g);
|
||||
tab_tree->add(g->label());
|
||||
g->hide();
|
||||
}
|
||||
|
|
@ -2085,10 +2073,10 @@ void SelectItem_CB(Fl_Widget *w) {
|
|||
pname = pn;
|
||||
size_t pos = std::string::npos;
|
||||
for (size_t i = 0; i < config_pages.size(); i++) {
|
||||
if ((pos = pname.find(config_pages[i]->label)) != std::string::npos) {
|
||||
if (pname.substr(pos) == config_pages[i]->label) {
|
||||
if ((pos = pname.find(config_pages[i]->label())) != std::string::npos) {
|
||||
if (pname.substr(pos) == config_pages[i]->label()) {
|
||||
if (current) current->hide();
|
||||
current = config_pages[i]->grp;
|
||||
current = config_pages[i];//->grp;
|
||||
current->show();
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,6 +95,7 @@ void XmlRpcUtil::log(int level, const char* fmt, ...)
|
|||
vsnprintf(buf,sizeof(buf)-1,fmt,va);
|
||||
buf[sizeof(buf)-1] = 0;
|
||||
XmlRpcLogHandler::getLogHandler()->log(level, buf);
|
||||
va_end(va);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -107,6 +108,7 @@ void XmlRpcUtil::error(const char* fmt, ...)
|
|||
vsnprintf(buf,sizeof(buf)-1,fmt,va);
|
||||
buf[sizeof(buf)-1] = 0;
|
||||
XmlRpcErrorHandler::getErrorHandler()->error(buf);
|
||||
va_end(va);
|
||||
}
|
||||
|
||||
// Returns true if the tag is parsed. No attributes are parsed.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue