From 13b1415dddc4b287a60029e92dabc2e8600c784b Mon Sep 17 00:00:00 2001 From: maxkadushkin Date: Tue, 27 Feb 2024 19:26:11 +0300 Subject: [PATCH] [macos] refactoring --- .../Code/Controllers/Common/ASCCommonViewController.mm | 3 +++ macos/ONLYOFFICE/Code/Utils/ascprinter.h | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/macos/ONLYOFFICE/Code/Controllers/Common/ASCCommonViewController.mm b/macos/ONLYOFFICE/Code/Controllers/Common/ASCCommonViewController.mm index 695d8a0c3..1d5ea6769 100644 --- a/macos/ONLYOFFICE/Code/Controllers/Common/ASCCommonViewController.mm +++ b/macos/ONLYOFFICE/Code/Controllers/Common/ASCCommonViewController.mm @@ -1034,6 +1034,9 @@ - (void)onCEFStartSave:(NSNotification *)notification { - (void)printOperationDidRun:(NSPrintOperation *)printOperation success:(BOOL)success contextInfo:(void *)contextInfo { if (m_pContext) { m_pContext->EndPaint(); + + m_pContext->Release(); + m_pContext = nullptr; } } diff --git a/macos/ONLYOFFICE/Code/Utils/ascprinter.h b/macos/ONLYOFFICE/Code/Utils/ascprinter.h index cf8da0cf2..713e90866 100644 --- a/macos/ONLYOFFICE/Code/Utils/ascprinter.h +++ b/macos/ONLYOFFICE/Code/Utils/ascprinter.h @@ -413,7 +413,6 @@ class ASCPrinterContext : public NSEditorApi::CAscPrinterContextBase m_pView = nil; isCurrentlyPrinting = false; - this->Release(); } virtual void GetLogicalDPI(int& nDpiX, int& nDpiY)