Browse Source

Update disposal comments in PdfDocumentCanvas to clarify lifetime management for SemanticTag and WriteStream

Marcin Ziąbek 2 months ago
parent
commit
c6c0280be0
1 changed files with 2 additions and 2 deletions
  1. 2 2
      Source/QuestPDF/Drawing/DocumentCanvases/PdfDocumentCanvas.cs

+ 2 - 2
Source/QuestPDF/Drawing/DocumentCanvases/PdfDocumentCanvas.cs

@@ -110,10 +110,10 @@ namespace QuestPDF.Drawing.DocumentCanvases
             Document?.Dispose();
             Document?.Dispose();
             CurrentPageCanvas?.Dispose();
             CurrentPageCanvas?.Dispose();
             DrawingCanvas?.Dispose();
             DrawingCanvas?.Dispose();
-            
-            // don't dispose SemanticTag - its lifetime is managed externally
             SemanticTag?.Dispose();
             SemanticTag?.Dispose();
             
             
+            // don't dispose WriteStream - its lifetime is managed externally
+            
             GC.SuppressFinalize(this);
             GC.SuppressFinalize(this);
         }
         }