Skip to content

Commit

Permalink
Fix for review of @luc
Browse files Browse the repository at this point in the history
  • Loading branch information
alkino committed Sep 21, 2023
1 parent 08d124b commit 0119b5e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/ivoc/graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2085,6 +2085,7 @@ void Graph::erase_all() {
Resource::unref(item);
}
line_list_.clear();
line_list_.shrink_to_fit();
label_n_ = 0;
}
void Graph::family_value() {
Expand Down
1 change: 0 additions & 1 deletion src/ivoc/ocpicker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ StandardPicker::StandardPicker() {
ms_ = unknown;
for (int i = 0; i < unknown; ++i) {
handlers_[i] = new std::vector<ButtonHandler*>();
handlers_[i]->reserve(1);
}
}
StandardPicker::~StandardPicker() {
Expand Down
1 change: 1 addition & 0 deletions src/ivoc/symdir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ void SymDirectoryImpl::disconnect(Observable*) {
delete item;
}
symbol_lists_.clear();
symbol_lists_.shrink_to_fit();
obj_ = NULL;
}

Expand Down
13 changes: 6 additions & 7 deletions src/ivoc/xmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,6 @@ HocPanel::HocPanel(const char* name, bool h)
}

HocPanel::~HocPanel() {
long i;
box_->unref();
for (auto& item: ilist_) {
item->HocItem::unref();
Expand All @@ -1039,7 +1038,10 @@ HocPanel::~HocPanel() {
if (it != hoc_panel_list->end()) {
hoc_panel_list->erase(it);
}
ilist_.clear();
ilist_.shrink_to_fit();
elist_.clear();
elist_.shrink_to_fit();
// printf("~HocPanel\n");
}

Expand All @@ -1059,11 +1061,9 @@ std::vector<HocUpdateItem*>* HocPanel::update_list_;
void HocPanel::keep_updated() {
static int cnt = 0;
if (update_list_ && (++cnt % 10 == 0)) {
long i, cnt = update_list_->size();
if (cnt)
for (auto& item: *update_list_) {
item->update_hoc_item();
}
for (auto& item: *update_list_) {
item->update_hoc_item();
}
}
}
void HocPanel::keep_updated(HocUpdateItem* hui, bool add) {
Expand Down Expand Up @@ -1372,7 +1372,6 @@ void HocPanel::save(std::ostream& o) {
void HocPanel::write(std::ostream& o) {
Oc oc;
char buf[200];
long i;
// o << "xpanel(\"" << getName() << "\")" << std::endl;
Sprintf(buf, "xpanel(\"%s\", %d)", getName(), horizontal_);
o << buf << std::endl;
Expand Down
1 change: 0 additions & 1 deletion src/nrncvode/occvode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,6 @@ void Cvode::play_add(PlayRecord* pr) {
CvodeThreadData& z = CTD(pr->ith_);
if (!z.play_) {
z.play_ = new std::vector<PlayRecord*>();
z.play_->reserve(1);
}
z.play_->push_back(pr);
}
Expand Down

0 comments on commit 0119b5e

Please sign in to comment.