D
Dave
Hi.
Could someone please tell me how I should correctly dispose of the
CreateMeasurementGraphics reference to stop the memory leak in the
following code:
For x = 1 To 10000
Dim PrintDocument As New Printing.PrintDocument
Dim g As Graphics =
PrintDocument.PrinterSettings.CreateMeasurementGraphics
Dim hdc As IntPtr = g.GetHdc()
g.ReleaseHdc(hdc)
g.Dispose()
PrintDocument.Dispose()
Next
Your help in much appreciated.
Dave
Could someone please tell me how I should correctly dispose of the
CreateMeasurementGraphics reference to stop the memory leak in the
following code:
For x = 1 To 10000
Dim PrintDocument As New Printing.PrintDocument
Dim g As Graphics =
PrintDocument.PrinterSettings.CreateMeasurementGraphics
Dim hdc As IntPtr = g.GetHdc()
g.ReleaseHdc(hdc)
g.Dispose()
PrintDocument.Dispose()
Next
Your help in much appreciated.
Dave