PIE Access violation with UUserWidget
Hi I get an access violation when I remove an UserWidget from the viewport during ending PIE.
During gamplay it is working as intended but if the PIE session is closed an exception is thowen in UnPossessed()
I am running into a similar issue.
I suspect this to be a twofold issue. UserWidget::RemoveFromViewport() calls GetViewportWidget() on a nulltpr returned from GetGameViewport() - see code below. So there should probably a nullptr-check before doing so.
However the real problem is that ending a PIE session seems to remove that GameViewport too early, since clearly the Game must be able to shut down its widgets in the same way regardless of the reason why the owning Actor has been shut down.
A workaround is to do that nullptr-check before calling RemoveFromViewport() and not remove the widget if the pointer is null. The Garbage Collection should take care of the problem but that is really bad style.
answered Sep 02 '14 at 12:36 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here