This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hello,
We discovered an issue in our application and digging deep we think that it might have something to do with the the property grid maintaining reference to the objects inside a bound collection, even after the collection is cleared. To demonstrate this we have put up a sample application (Attached). Following are the steps to reproduce the issue we are facing: Step 1: Run the application 1.1 : The sample application constructs 6 Person objects as private data member instances. 1.2 : The appropriate data binding context is set. 1.3 : The sample then initializes the MultipleObjectWrapper with the 6 person objects specified above. 1.4 : When the sample loads these Person objects are now shown by the property grid. Step 2: Click the “Clear Property Grid” button. 2.1 : The sample application now “nulls” the MultipleObjectWrapper that was initialized in step 1.3. It is then assumed that the property grid has now released all references including any change events. Further the property grid view has also been successfully cleared. Step 3: Click the “Perform A Change” button. 3.1 : The sample application now starts a second thread which performs a change of the Name property on the Person 1 object instance initialized in step 1.1. When doing so the second thread raises an exception that it cannot reference the Person object (person1) because another thread is already maintaining a reference to person 1. Conclusion: It is suspected that the PropertyGrid is still maintaining a reference to all of the person objects created above. To test this theory a seventh object has been created in step 1.1 which does not get included in the property grid. When clicking the “Perform Change 7” button the sample then changes the person7 Name property which does not cause a crash. Any help from your end would be highly appreciated. |
|
|
Are you using a v1 nightly build or v2? There was an issue in v1 where the grid would hold onto references because it failed to unhook PropertyChanged events; the scenarios we identified were fixed in v2, but we may not have caught every scenario. If you're using v1, could you try it with v2 and let us know if it still happens? Thanks! If it does happen, can you let us know the urgency? We have limited resources over the Christmas break I'm afraid. |
|
|
Hi Ivan, we just tested it against v2 and still have the same exception showing up. We have a beta release coming up on 6th of January, and the workaround we have is very inconvenient for the users. It would be great to have a fix before the release. Hi Ivan, we just tested it against v2 and still have the same exception showing up.
We have a beta release coming up on 6th of January, and the workaround
we have is very inconvenient for the users. It would be great to have a
fix before the release. |
|
|
Righty ho. We'll have a look into this and aim to get you something in good time for you to integration test prior to your beta date. Thanks for the detailed repro instructions, these will definitely help! |
|
|
Thanks Ivan. You guys are always very helpful and quick. Cheers |
|
|
I have committed an interim workaround and this will be in tonight's nightly build. You are right that there is an underlying issue of the grid holding onto references in multiple-object mode, and this will cause a memory leak if your application is long-lived and puts a lot of things into MultipleObjectWrappers over time. However the exception which is causing you immediate problems is specific to the use of a worker thread -- when you make the change on the worker thread, this causes grid update code to run on that worker thread, which causes the exception. I have changed this so that the grid update code gets marshalled to the grid thread, so you should now be able to make changes on a worker thread without getting an exception. I realise this is kinda fixing the symptoms rather than the root cause, but the root cause (the failure to release references) will take a bit longer to fix and hopefully the memory leak will not be a showstopper for your beta. If you would like to get this build before you break for Christmas then let me know and I will try to get hold of our Web guy and get him to push out the update this afternoon (no promises though). |
|
|
Excellent! Thank you Ivan. |
|
|
Hi Ivan, We just got the latest nightly build and tested it with the original sample (attached in the first post) , and we still have the same problem/exception as described then. Any ideas why this might be happening even with the workaround you mentioned on 24th? |
|
|
Oh dear -- it seems the commit somehow got borked, probably somewhere between the joys of rural broadband and the mystery of VPNs, so the fix never got included. I have recommitted the fix/workaround, verified the commit and rebuilt. JD will be uploading it as a nightly asap and will post here as soon as it is available. Apologies for the fault and for the delay in picking this up again -- I know you are on a tight deadline and I realise it is important for you to have time to integration-test the new release. |
|
|
No worries Ivan, I will get the latest as soon as it is available. Thanks |
|
|
Could you please try the nightly now - I've just done a push of the nightly builds. Let us know if you still notice an issue. I hope that helps, John-Daniel |
|
|
That works! Thanks a lot for the quick fix and respose, especially because this is holiday time. Cheers |
|
|
Hi! I've discovered probably a related issue with the 20.01.2009 release of the property grid. At some moment in my application I assign Null to PG.SelectedObject instead of a previously selected object. However, looking later on at subscribers for OnPropertyChanged of that object (through InvocationList) I still see many Minscape.WPFPropertyGrid.Many objects in it. I also have an impression that this affect perfomance in my application, although it has to be tested to confirm. I suppose it's a similar bug but this time with the wrappers rather then the grid itself.
|
|
|
Hello Corvex, This is either a related issue or the same one -- as mentioned above we did not have time to fix the underlying memory leak for tarangwaghela's beta drop, so the problem is still in there and will potentially affect applications which are long-running or frequently change SelectedObjects. If this is causing you a performance problem then let us know and we will bump this up the priority list! |
|
|
Hello Corvex, We now have a candidate fix for the memory leak in multiple selection and it will be included in nightly builds dated 11 Feb 2009 and above, available from about 1430 GMT. If the leak is still causing you a problem, give it a try and let us know if things don't improve. |
|
|
Hi Ivan, I downloaded a new version and there is no trace of the described problem.Thank you for the great support! |
|