diff options
author | Michael Vrhel <michael.vrhel@artifex.com> | 2014-01-10 12:13:04 -0800 |
---|---|---|
committer | Michael Vrhel <michael.vrhel@artifex.com> | 2014-01-15 10:11:37 -0800 |
commit | 8b3881b67d481cdb42540cdab54898f160653771 (patch) | |
tree | f73b5608dbc51206d0520296cfbbaa8233684aa6 /platform/winrt/mupdf_cpp/MainPage.xaml.cpp | |
parent | c3305e7280d446737fbad0dba13712385becf7ad (diff) | |
download | mupdf-8b3881b67d481cdb42540cdab54898f160653771.tar.xz |
Fixes for Windows 8.1 store validation
We have to clean up the DirectX memory during suspension.
Also define NDEBUG for the release cases so that we avoid the use of OutputDebugStringA
in error.c which is not allowed in Windows store apps.
Diffstat (limited to 'platform/winrt/mupdf_cpp/MainPage.xaml.cpp')
-rw-r--r-- | platform/winrt/mupdf_cpp/MainPage.xaml.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/platform/winrt/mupdf_cpp/MainPage.xaml.cpp b/platform/winrt/mupdf_cpp/MainPage.xaml.cpp index fa717084..a57a7a23 100644 --- a/platform/winrt/mupdf_cpp/MainPage.xaml.cpp +++ b/platform/winrt/mupdf_cpp/MainPage.xaml.cpp @@ -7,6 +7,7 @@ #include "MainPage.xaml.h" #include <regex> #include <sstream> +#include "DXGI1_3.h" #define LOOK_AHEAD 1 /* A +/- count on the pages to pre-render */ #define THUMB_PREADD 10 @@ -106,7 +107,9 @@ MainPage::MainPage() SetUpDirectX(); RegisterForPrinting(); CleanUp(); +#ifndef NDEBUG RecordMainThread(); +#endif /* So that we can catch special loading events (e.g. open with) */ _pageLoadedHandlerToken = Loaded += ref new RoutedEventHandler(this, &MainPage::Page_Loaded); } @@ -211,9 +214,12 @@ void MainPage::ExceptionHandler(Object^ sender, UnhandledExceptionEventArgs^ e) } } +/* We need to clean up (Trim) the directX memory on suspension */ void MainPage::App_Suspending(Object^ sender, SuspendingEventArgs^ e) { - + ComPtr<IDXGIDevice3> pDXGIDevice; + ThrowIfFailed(m_d3d_device.As(&pDXGIDevice)); + pDXGIDevice->Trim(); } void MainPage::ExitInvokedHandler(Windows::UI::Popups::IUICommand^ command) |