Memory Leak from NStylePreviewEditor


Author
Message
Mark Demory
Mark Demory
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)
Group: Forum Members
Posts: 1, Visits: 1

The Text Style editor creates a new instance of class NStylePreviewEditor every time it is opened.  These objects never get cleaned up, in the example code Nevron provided with the following version:
    .NET Vision 2010.1 for VS2010 version 11.1.17.12

The NStylePreviewEditor is never properly disposed, causing a catastrophic memory leak.  We have users who need to open this editor dozens of times on one Nevron document, which causes our application to fail because all memory is consumed.

Here is the code we use to allow the user to change, for example, the default font size for a Nevron document or object:

    result = NTextStyleTypeEditor.Edit(Me.Document.Style.TextStyle, newTextStyle)


We are using VB.Net for .NET 4.0.

We used sos.dll and the following command to discover that every time a user opens the Text Style editor a new instance of this object is created, and never released:

    !dumpheap -type Nevron.Editors.NStylePreviewEditor


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search