02-21-2012, 03:35 PM
It is correct to just change the Source property of SvgViewbox.
I have checked the control again and do not see any increase of memory or leaked handles when the Source is changed multiple times.
Maybe you have some references to the read objects from your code that do not allow Garbage collector to free them.
Could you please check your application with task manager or process explorer and check if the memory is increasing constantly. Also please check for references from your code (note that subscribing to events on read objects also adds a reference to the objects).
Do you get the error just on specific files or any files (after some time). Sometimes the out of memory exception is thrown when the images embedded into svg file are not correctly defined - for example the data for the image wants to create an image with size 10000 x 20000.
If you still do not find the cause please create a simple application with some of your svg files that could be used to reproduce the problems. Please send your application on the feedback form (http://www.wpf-graphics.com/Feedback.aspx)
I have checked the control again and do not see any increase of memory or leaked handles when the Source is changed multiple times.
Maybe you have some references to the read objects from your code that do not allow Garbage collector to free them.
Could you please check your application with task manager or process explorer and check if the memory is increasing constantly. Also please check for references from your code (note that subscribing to events on read objects also adds a reference to the objects).
Do you get the error just on specific files or any files (after some time). Sometimes the out of memory exception is thrown when the images embedded into svg file are not correctly defined - for example the data for the image wants to create an image with size 10000 x 20000.
If you still do not find the cause please create a simple application with some of your svg files that could be used to reproduce the problems. Please send your application on the feedback form (http://www.wpf-graphics.com/Feedback.aspx)
Andrej Benedik

