-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Microsoft.Maui.Controls.Element: Warning: The RealParent on Microsoft.Maui.Controls.Shapes.RoundRectangle has been Garbage Collected. This should never happen. Please log a bug: https://github.com/dotnet/maui #23050
Comments
Hi I'm an AI powered bot that finds similar issues based off the issue title. Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you! Closed similar issues:
|
Does your app also throw this exception in sr6 8.0.40? Do you have a repro by chance? If it's hard to repro can you paste your xaml that uses RoundRectangle |
Hello,
I really don’t remember to see that event on the previous version of Microsoft.Maui.Controls, and I’m aware of the application log.
I don’t have any repro, but if you want I’m glad to show you on screen sharing.
I did not mention but the event occurs without an application crash.
Best regards,
João Eduardo Martins
… On 15 Jun 2024, at 00:28, Shane Neuville ***@***.***> wrote:
@snufffgit <https://github.com/snufffgit>
Does your app also throw this exception in sr6 8.0.40?
Do you have a repro by chance?
If it's hard to repro can you paste your xaml that uses RoundRectangle
—
Reply to this email directly, view it on GitHub <#23050 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AH4GL5TDQY4VNJLOWUBWV5LZHN4CRAVCNFSM6AAAAABJJMAZU6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRYHA4DAMBSGQ>.
You are receiving this because you were mentioned.
|
I'm using sr6, and this is reported in Sentry multiple times for multiple UI controls, since I switched to sr6. I have multiple logs. I'm posting one:
|
Related #23139 |
I confirm that it is only since SR6 that does happen. |
@snufffgit do you have any code examples you can include here where you are using |
I have examples of this issue report in sentry where the UI control involved change everytime. I would conclude that it is not related to the UI control used. |
I'm also getting this warning from time to time: And also: MAUI 8.0.60 SR6 |
Had the same debug massage after update to maui 8.0.61 on Windows, combined with bad ui performance. Back to 8.0.40 - messages gone and performance is normal. Only part where RoundRectangle is used, but lots of borders are loaded in Collectionviews and Flexlayouts: |
Okay, so my first question is why neither I nor the AI that looks for possible duplicates could find this one in a search. But anyways... In my case, I'm getting the error for some images as well as for RoundRectangle. In the case of the images, I'm using a derived class that applies a behavior to tint the images. I can't imagine that would cause this, but who knows? Here is the XAML for the image (one thing I do notice immediately is that the target type for IconStyleBase is Image, not TintedImage):
Here is the code for the TintImage control:
Here is one example of the RoundRectangle issue. Both issues seem to be coming from a ContentView. In one of those, the XAML is a control template. In the other it is not. In both cases, the StrokeShape property is bound to a bindable property on the ContentView.
Finally, here is the Style that is applying RoundRectangle to the ContentView:
As an aside, I was looking through the Sentry logs and there are some images where it happens pretty much every time that page loads. There is another case where I have a custom control that is on virtually every setup and settings page in my app - and there are a lot - and it only happened once for that control and it has happened a couple dozen times for the other images it's affecting. Also, I should point out that I'm currently in development, so I'm the only user. That's why the numbers are so low. |
Ah that explains my issues with custom image sources that i am using as they are applied through a behavior too. This bug is being cornered. |
Is there any solution to this other than reverting your Maui version? It floods my logging and am often not sure if issues are caused by this or something else. |
On StackOverflow, I was testing my answer to this question and stumbled upon this unexpected output. This may be a possible repro and might save someone a little legwork. ___This testbench code lives on a specific branch in this repro: Clone: windows-machine-successful-test UPDATE: After letting it run for a while I got a total of 21 occurrences of
|
@PureWeen Is this PR the cause of the warnings?
|
For me this is happening at app start-up in CollectionView in iOS with 8.0.91 (the latest version). |
Have see same problem a few times
Context could be open and closing Maui Community PopUp defined in Xaml and I have only seen it when building to release mode.
Regards |
Because of big memory leaks in a custom ContentView I tried to free up allocated memory by disconnecting handlers and setting all child views to null and call ClearLogicalChildren () for example.. But when I do that, this error occurs for almost every element inside the ContentView. I am also using Border with a Binding to StrokeShape of the ContentView. And also an Image element with a TintColorBehavior. I don't know if this helps in some way, but I hope it will. |
This happened to us also with 2 users today. SBOM:
|
FYI - This crash has now happened 10 times in the last 48 hours as captured by sentry.io. Only on iOS so far. |
We were not seeing this crash until our most recent release. Should I open a new issue? |
I did notice that this crash is happening on a view with control templates.
|
Just happened to me on an Android release build, no sign of it on debug builds. |
This issue says it happens on windows and they have a repro: #26872 Repro: https://github.com/King-Taz/NavBar CSI says they can repro:
|
I encountered a similar issue. When using an Image and setting the Source to an ImageSource which will be set from a static function. If you run this app on iOS and navigate a few times to the second page and back the following Warning will be logged twice: In our actual application this will produce a massive log spam. |
@FinnKr that warning pops up when you use the .Parent property. Remove any code reading .Parent and all warnings are gone ! |
@softlion Thank you for your answer but unfortunately this warning occurs even when not using the .Parent property. As you can see in the linked repository, there is no usage of "Parent". |
There's probably a few things going on here. One area that I'm thinking could lead to this is that if you use a strokeshape on a border as a static resource |
getting this on IOS simulator in Debug No references to parent in my code. |
Description
Microsoft.Maui.Controls.Element: Warning: The RealParent on Microsoft.Maui.Controls.Shapes.RoundRectangle has been Garbage Collected. This should never happen. Please log a bug: https://github.com/dotnet/maui
Steps to Reproduce
I'm reporting the bug as instructed by the Application Output
Link to public reproduction project repository
Possible reproduction here
#23050 (comment)
Version with bug
8.0.40 SR5
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output
The text was updated successfully, but these errors were encountered: