Click here to Skip to main content
15,911,531 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: Scrollbars Not Enabling Pin
Gerry Schmitz2-Mar-18 9:59
mveGerry Schmitz2-Mar-18 9:59 
QuestionHighlight Searched Text with ListView in WPF Pin
Member 1313673327-Feb-18 14:17
Member 1313673327-Feb-18 14:17 
AnswerRe: Highlight Searched Text with ListView in WPF Pin
Richard MacCutchan27-Feb-18 21:26
mveRichard MacCutchan27-Feb-18 21:26 
AnswerRe: Highlight Searched Text with ListView in WPF Pin
Gerry Schmitz28-Feb-18 7:53
mveGerry Schmitz28-Feb-18 7:53 
QuestionWPF memory leak BitmapImage Pin
Leif Simon Goodwin21-Feb-18 1:53
Leif Simon Goodwin21-Feb-18 1:53 
AnswerRe: WPF memory leak BitmapImage Pin
#realJSOP22-Feb-18 1:32
professional#realJSOP22-Feb-18 1:32 
GeneralRe: WPF memory leak BitmapImage Pin
Leif Simon Goodwin22-Feb-18 5:30
Leif Simon Goodwin22-Feb-18 5:30 
AnswerRe: WPF memory leak BitmapImage Pin
MadMyche22-Feb-18 4:09
professionalMadMyche22-Feb-18 4:09 
GeneralRe: WPF memory leak BitmapImage Pin
Leif Simon Goodwin22-Feb-18 5:31
Leif Simon Goodwin22-Feb-18 5:31 
GeneralRe: WPF memory leak BitmapImage Pin
MadMyche22-Feb-18 8:31
professionalMadMyche22-Feb-18 8:31 
GeneralRe: WPF memory leak BitmapImage Pin
Leif Simon Goodwin23-Feb-18 2:36
Leif Simon Goodwin23-Feb-18 2:36 
AnswerRe: WPF memory leak BitmapImage Pin
Gerry Schmitz22-Feb-18 4:46
mveGerry Schmitz22-Feb-18 4:46 
GeneralRe: WPF memory leak BitmapImage Pin
Leif Simon Goodwin22-Feb-18 5:29
Leif Simon Goodwin22-Feb-18 5:29 
GeneralRe: WPF memory leak BitmapImage Pin
Gerry Schmitz22-Feb-18 5:54
mveGerry Schmitz22-Feb-18 5:54 
GeneralRe: WPF memory leak BitmapImage Pin
Leif Simon Goodwin22-Feb-18 23:57
Leif Simon Goodwin22-Feb-18 23:57 
AnswerRe: WPF memory leak BitmapImage Pin
Leif Simon Goodwin8-Mar-18 22:35
Leif Simon Goodwin8-Mar-18 22:35 
Thank you to everyone for your thoughts. It appears to be unrelated to the version of .Net.

I found the source for MemoryStream and the Dispose method does NOT set the buffer reference to null. I tried assigning a static buffer to the MemoryStream instance instead of allowing it to allocate its own buffer but that caused a crash.

I created test WPF and WinForms apps and the results are bizarre.

We have a small C# class - VideoOCRWrapper - which drives an attached OCR document scanner. It essentially makes calls to a C++ DLL, and has a callback which receives a IntPtr containing a HWND. On receipt of a bitmap, it converts it to a BitmapImage and fires an event to provide a client with the BitmapImage isntance.

I created a WinForms app, which initialises VideoOCRWrapper and displays the received bitmap. It has converts the BitmapImage to a Bitmap for display.It shows no memory leaks.

I created a WPF app, which initialises VideoOCRWrapper and displays the received bitmap. It shows a huge memory leak consistent with the bitmap buffer leaking.

The two apps use almost the same code, except that the WinForms overrides the form's WndProc, whereas the WPF app hooks its own WndProc onto the main window.

I memory profiled the WPF test app, and it said that "22 types have instances that are queued for finalization. This can indicate that a Finalizer method is stuck, which will prevent instances from being finalized and cause memory leaks.".

There is an extra factor. We use a third party DLL for document verification, which receives bitmaps from us. If I remove that DLL, our code shows no leaks. If I add that DLL, we have leaks but only when running our WPF test app, or our WPF application. When running the WinForms test app, we have no leaks.
Question"Cylinder lens" scrollbar Pin
kalberts19-Feb-18 3:33
kalberts19-Feb-18 3:33 
AnswerRe: "Cylinder lens" scrollbar Pin
Gerry Schmitz19-Feb-18 6:53
mveGerry Schmitz19-Feb-18 6:53 
GeneralRe: "Cylinder lens" scrollbar Pin
kalberts19-Feb-18 22:18
kalberts19-Feb-18 22:18 
QuestionPassing Data From a window to the mainview(shellViewModel) using EventAggregator - WPF Caliburn.Micro Pin
Dwayne Barsotta27-Jan-18 6:05
Dwayne Barsotta27-Jan-18 6:05 
AnswerRe: Passing Data From a window to the mainview(shellViewModel) using EventAggregator - WPF Caliburn.Micro Pin
Gerry Schmitz27-Jan-18 12:10
mveGerry Schmitz27-Jan-18 12:10 
GeneralRe: Passing Data From a window to the mainview(shellViewModel) using EventAggregator - WPF Caliburn.Micro Pin
Dwayne Barsotta27-Jan-18 12:20
Dwayne Barsotta27-Jan-18 12:20 
GeneralRe: Passing Data From a window to the mainview(shellViewModel) using EventAggregator - WPF Caliburn.Micro Pin
Gerry Schmitz27-Jan-18 12:54
mveGerry Schmitz27-Jan-18 12:54 
GeneralRe: Passing Data From a window to the mainview(shellViewModel) using EventAggregator - WPF Caliburn.Micro Pin
Dwayne Barsotta27-Jan-18 19:47
Dwayne Barsotta27-Jan-18 19:47 
GeneralRe: Passing Data From a window to the mainview(shellViewModel) using EventAggregator - WPF Caliburn.Micro Pin
Gerry Schmitz28-Jan-18 8:28
mveGerry Schmitz28-Jan-18 8:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.