summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/global/qcompilerdetection.h5
-rw-r--r--src/corelib/global/qlogging.cpp8
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp18
3 files changed, 28 insertions, 3 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index 7effb24130..d144c4faad 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -557,7 +557,10 @@
# define Q_COMPILER_UNRESTRICTED_UNIONS
# endif
# if __INTEL_COMPILER >= 1500
-# define Q_COMPILER_CONSTEXPR
+# if __INTEL_COMPILER * 100 + __INTEL_COMPILER_UPDATE >= 150001
+// the bug mentioned above is fixed in 15.0.1
+# define Q_COMPILER_CONSTEXPR
+# endif
# define Q_COMPILER_ALIGNAS
# define Q_COMPILER_ALIGNOF
# define Q_COMPILER_INHERITING_CONSTRUCTORS
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
index fa897d6d32..18b672d7ee 100644
--- a/src/corelib/global/qlogging.cpp
+++ b/src/corelib/global/qlogging.cpp
@@ -873,7 +873,7 @@ QMessagePattern::QMessagePattern()
QMessagePattern::~QMessagePattern()
{
- for (int i = 0; literals[i] != 0; ++i)
+ for (int i = 0; literals[i]; ++i)
delete [] literals[i];
delete [] literals;
literals = 0;
@@ -883,8 +883,12 @@ QMessagePattern::~QMessagePattern()
void QMessagePattern::setPattern(const QString &pattern)
{
+ if (literals) {
+ for (int i = 0; literals[i]; ++i)
+ delete [] literals[i];
+ delete [] literals;
+ }
delete [] tokens;
- delete [] literals;
// scanner
QList<QString> lexemes;
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index ca3d92bad1..6b0ebf8b8b 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -81,6 +81,11 @@
#ifdef Q_OS_WIN
# ifdef Q_OS_WINRT
# include "qeventdispatcher_winrt_p.h"
+# include "qfunctions_winrt.h"
+# include <wrl.h>
+# include <Windows.ApplicationModel.core.h>
+ using namespace ABI::Windows::ApplicationModel::Core;
+ using namespace Microsoft::WRL;
# else
# include "qeventdispatcher_win_p.h"
# endif
@@ -1221,6 +1226,19 @@ void QCoreApplication::exit(int returnCode)
QEventLoop *eventLoop = data->eventLoops.at(i);
eventLoop->exit(returnCode);
}
+#ifdef Q_OS_WINRT
+ qWarning("QCoreApplication::exit: It is not recommended to explicitly exit an application on Windows Store Apps");
+ ComPtr<ICoreApplication> app;
+ HRESULT hr = RoGetActivationFactory(Wrappers::HString::MakeReference(RuntimeClass_Windows_ApplicationModel_Core_CoreApplication).Get(),
+ IID_PPV_ARGS(&app));
+ RETURN_VOID_IF_FAILED("Could not acquire ICoreApplication object");
+ ComPtr<ICoreApplicationExit> appExit;
+
+ hr = app.As(&appExit);
+ RETURN_VOID_IF_FAILED("Could not acquire ICoreApplicationExit object");
+ hr = appExit->Exit();
+ RETURN_VOID_IF_FAILED("Could not exit application");
+#endif // Q_OS_WINRT
}
/*****************************************************************************