summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI')
-rw-r--r--Swift/QtUI/CAPICertificateSelector.cpp23
-rw-r--r--Swift/QtUI/QtUIFactory.cpp8
-rw-r--r--Swift/QtUI/QtUIFactory.h2
3 files changed, 21 insertions, 12 deletions
diff --git a/Swift/QtUI/CAPICertificateSelector.cpp b/Swift/QtUI/CAPICertificateSelector.cpp
index 36d8c54..e47121b 100644
--- a/Swift/QtUI/CAPICertificateSelector.cpp
+++ b/Swift/QtUI/CAPICertificateSelector.cpp
@@ -18,7 +18,9 @@
#include <boost/algorithm/string.hpp>
#include <Swift/Controllers/Intl.h>
#include <Swift/QtUI/QtSwiftUtil.h>
+
#include <Swiften/Base/Log.h>
+#include <Swiften/TLS/Schannel/SchannelUtil.h>
namespace Swift {
@@ -87,23 +89,22 @@ std::string selectCAPICertificate() {
}
}
-
-
+ std::string result;
/* Call Windows dialog to select a suitable certificate */
- PCCERT_CONTEXT cert = CryptUIDlgSelectCertificateFromStore(hstore, hwnd, titleChars, promptChars, exclude_columns, 0, NULL);
+ {
+ ScopedCertContext cert(CryptUIDlgSelectCertificateFromStore(hstore, hwnd, titleChars, promptChars, exclude_columns, 0, NULL));
+ if (cert) {
+ result = getCertUri(cert, certStoreName);
+ }
+ }
delete[] titleChars;
delete[] promptChars;
if (hstore) {
- CertCloseStore(hstore, 0);
- }
-
- std::string result;
-
- if (cert) {
- result = getCertUri(cert, certStoreName);
- CertFreeCertificateContext(cert);
+ if (CertCloseStore(hstore, 0) == FALSE) {
+ SWIFT_LOG(debug) << "Failed to close the certificate store handle." << std::endl;
+ }
}
return result;
diff --git a/Swift/QtUI/QtUIFactory.cpp b/Swift/QtUI/QtUIFactory.cpp
index ece29ec..d3b30de 100644
--- a/Swift/QtUI/QtUIFactory.cpp
+++ b/Swift/QtUI/QtUIFactory.cpp
@@ -10,6 +10,7 @@
#include <QSplitter>
+#include <Swiften/Base/Log.h>
#include <Swiften/Whiteboard/WhiteboardSession.h>
#include <Swift/Controllers/Settings/SettingsProviderHierachy.h>
@@ -46,6 +47,13 @@ QtUIFactory::QtUIFactory(SettingsProviderHierachy* settings, QtSettingsProvider*
this->tabs = dynamic_cast<QtChatTabs*>(tabsBase);
}
+QtUIFactory::~QtUIFactory() {
+ SWIFT_LOG(debug) << "Entering QtUIFactory destructor. chatWindows size:" << chatWindows.size() << std::endl;
+ for (auto chat : chatWindows) {
+ SWIFT_LOG_ASSERT(!chat.isNull(), debug) << "QtUIFactory has active chat windows and has not been reset properly" << std::endl;
+ }
+}
+
XMLConsoleWidget* QtUIFactory::createXMLConsoleWidget() {
QtXMLConsoleWidget* widget = new QtXMLConsoleWidget();
tabsBase->addTab(widget);
diff --git a/Swift/QtUI/QtUIFactory.h b/Swift/QtUI/QtUIFactory.h
index 18bf9fe..9989101 100644
--- a/Swift/QtUI/QtUIFactory.h
+++ b/Swift/QtUI/QtUIFactory.h
@@ -36,7 +36,7 @@ namespace Swift {
Q_OBJECT
public:
QtUIFactory(SettingsProviderHierachy* settings, QtSettingsProvider* qtOnlySettings, QtChatTabsBase* tabs, QtSingleWindow* netbookSplitter, QtSystemTray* systemTray, QtChatWindowFactory* chatWindowFactory, TimerFactory* timerFactory, StatusCache* statusCache, AutoUpdater* autoUpdater, bool startMinimized, bool emoticonsExist, bool enableAdHocCommandOnJID);
-
+ ~QtUIFactory();
virtual XMLConsoleWidget* createXMLConsoleWidget();
virtual HistoryWindow* createHistoryWindow(UIEventStream*);
virtual MainWindow* createMainWindow(UIEventStream* eventStream);