Skip to content

Commit

Permalink
fixes #945
Browse files Browse the repository at this point in the history
  • Loading branch information
nonlin-lin-chaos-order-etc-etal committed Sep 8, 2017
1 parent 1673966 commit ef30d2d
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 6 deletions.
1 change: 1 addition & 0 deletions qt/i2pd_qt/ClientTunnelPane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ void ClientTunnelPane::setGroupBoxTitle(const QString & title) {
}

void ClientTunnelPane::deleteClientTunnelForm() {
TunnelPane::deleteTunnelForm();
delete clientTunnelNameGroupBox;
clientTunnelNameGroupBox=nullptr;

Expand Down
1 change: 1 addition & 0 deletions qt/i2pd_qt/ServerTunnelPane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ int ServerTunnelPane::appendServerTunnelForm(
}

void ServerTunnelPane::deleteServerTunnelForm() {
TunnelPane::deleteTunnelForm();
delete serverTunnelNameGroupBox;//->deleteLater();
serverTunnelNameGroupBox=nullptr;

Expand Down
4 changes: 4 additions & 0 deletions qt/i2pd_qt/TunnelPane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,3 +218,7 @@ QString TunnelPane::readTunnelTypeComboboxData() {
i2p::data::SigningKeyType TunnelPane::readSigTypeComboboxUI(QComboBox* sigTypeComboBox) {
return (i2p::data::SigningKeyType) sigTypeComboBox->currentData().toInt();
}

void TunnelPane::deleteTunnelForm() {
widgetlocks.deleteListeners();
}
3 changes: 3 additions & 0 deletions qt/i2pd_qt/TunnelPane.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ class TunnelPane : public QObject {
TunnelPane(TunnelsPageUpdateListener* tunnelsPageUpdateListener_, TunnelConfig* tunconf);
virtual ~TunnelPane(){}

void deleteTunnelForm();


virtual ServerTunnelPane* asServerTunnelPane()=0;
virtual ClientTunnelPane* asClientTunnelPane()=0;

Expand Down
4 changes: 3 additions & 1 deletion qt/i2pd_qt/widgetlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class widgetlock : public QObject {
private:
QWidget* widget;
QPushButton* lockButton;

public slots:
void lockButtonClicked(bool) {
bool wasEnabled = widget->isEnabled();
Expand All @@ -25,7 +26,8 @@ public slots:
lockButton->setText(lockButton->tr("Edit"));
QObject::connect(lockButton,SIGNAL(clicked(bool)), this, SLOT(lockButtonClicked(bool)));
}
virtual ~widgetlock() {
virtual ~widgetlock() {}
void deleteListener() {
QObject::disconnect(lockButton,SIGNAL(clicked(bool)), this, SLOT(lockButtonClicked(bool)));
}
};
Expand Down
14 changes: 9 additions & 5 deletions qt/i2pd_qt/widgetlockregistry.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,19 @@ class widgetlockregistry {

public:
widgetlockregistry() : locks() {}
virtual ~widgetlockregistry() {
virtual ~widgetlockregistry() {}
void add(widgetlock* lock) {
locks.push_back(lock);
}

void deleteListeners() {
while(!locks.empty()) {
delete locks.back();
widgetlock* lock = locks.back();
lock->deleteListener();
delete lock;
locks.pop_back();
}
}
void add(widgetlock* lock) {
locks.push_back(lock);
}
};

#endif // WIDGETLOCKREGISTRY_H

0 comments on commit ef30d2d

Please sign in to comment.