View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001707 | NoesisGUI | C++ SDK | public | 2020-05-28 11:37 | 2020-09-24 16:38 |
Reporter | steveh | Assigned To | jsantos | ||
Priority | normal | Severity | feature | Reproducibility | N/A |
Status | assigned | Resolution | open | ||
Product Version | 3.0 | ||||
Target Version | 3.0 | Fixed in Version | |||
Summary | 0001707: Feature request: Identify and notify the user about cyclic references | ||||
Description | Hi guys, I've recently been looking at cleaning up our shutdown code and I've fixed a few issues where a child holds a ref counted pointer to a parent object in the hierarchy. This ultimately creates a cyclic dependency between the two objects and prevents them from being cleaned up. I've attached 2 examples of code which might do this, the first is setting a DataContext to a parent object, and another is setting the TargetName on a GoToStateAction to a parent object. It would be extremely helpful to try and detect these cases. Perhaps in debug you could assert if the TargetName or DataContext are trying to be set to a parent object in the hierarchy when you set the pointer. Or perhaps a better way is to try and find these cyclic references in shutdown if we've detected that we've leaked memory. Essentially any further information to help track these issues down would be extremely beneficial! Cheers. | ||||
Steps To Reproduce | 1. Use the attached XAML files in the ApplicationLauncher Noesis sample. 2. Close the application launcher. 3. The application will leak and halt if attached in the debugger in Noesis::Shutdown if (GetAllocatedMemory() > 0) { NS_LOG_WARNING("Memory leaks detected: %d bytes", GetAllocatedMemory()); #if defined(NS_DEBUG) && defined(NS_PLATFORM_WINDOWS) if (IsDebuggerPresent()) { NS_DEBUG_BREAK; } #endif | ||||
Tags | No tags attached. | ||||
Platform | Any | ||||
related to | 0001706 | resolved | sfernandez | Memory leak when binding DataContext to parent user control |
related to | 0001798 | resolved | sfernandez | Memory leak when using ContextMenuService.PlacementTarget |
DataContext.xaml (571 bytes) GoToStateAction.xaml (1,489 bytes) |
|
A high-level leak detector with extra information like class name is definitely a good idea. I will try this with your scenario (cyclic dependencies when setting DataContext) to see how useful it is. Thanks for the suggestion! |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2020-05-28 11:37 | steveh | New Issue | |
2020-05-28 11:37 | steveh | File Added: DataContext.xaml | |
2020-05-28 11:37 | steveh | File Added: GoToStateAction.xaml | |
2020-05-28 19:08 | sfernandez | Relationship added | related to 0001706 |
2020-06-08 14:02 | jsantos | Assigned To | => jsantos |
2020-06-08 14:02 | jsantos | Status | new => assigned |
2020-06-08 14:04 | jsantos | Note Added: 0006428 | |
2020-06-08 14:04 | jsantos | Target Version | => 3.0 |
2020-06-08 14:04 | jsantos | Description Updated | View Revisions |
2020-06-08 14:04 | jsantos | Steps to Reproduce Updated | View Revisions |
2020-06-08 14:05 | jsantos | Note Edited: 0006428 | View Revisions |
2020-06-08 14:05 | jsantos | Note Edited: 0006428 | View Revisions |
2020-09-24 16:38 | sfernandez | Relationship added | related to 0001798 |