From 8b3881b67d481cdb42540cdab54898f160653771 Mon Sep 17 00:00:00 2001 From: Michael Vrhel Date: Fri, 10 Jan 2014 12:13:04 -0800 Subject: 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. --- platform/winrt/mupdf_cpp/MainPage.xaml.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'platform/winrt/mupdf_cpp/MainPage.xaml.cpp') 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 #include +#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 pDXGIDevice; + ThrowIfFailed(m_d3d_device.As(&pDXGIDevice)); + pDXGIDevice->Trim(); } void MainPage::ExitInvokedHandler(Windows::UI::Popups::IUICommand^ command) -- cgit v1.2.3