Hi! I would like to report an error. I double clicked the AP, make it fullscreen. Then, double clicked again to exit fullscreen. I've got the following error. I restarted the project the get sure. It is an error on 1.4.2
From your additional posts, we did some more testing.
And the error similar to what you reported is when I repeat activation > deactivation > activation of the AnyPortrait editor while docked.
You can reproduce this issue by taking an action such as launching the game, and the detailed error log may vary slightly depending on the action taken.
The "error log from apEditor" you mentioned occurs "when uninitialized data is accessed", but the problem is that this is not constant.
If it's a problem with the same data, we can fix it by correcting it to detect it.
Actually, but the error log in your comment is caused by "resources for rendering" being unloaded, while in our test it was caused by "user's configuration data" being unloaded.
And other users in the past have reported similar errors in completely different code.
Therefore, we cannot solve the problem with this approach.
Our team wrote a script in Unity 2022.2 and received information and events related to docking from the Unity Editor and checked it.
As you said, if we put "Validation" code in it, i.e. if it detects that the docked editor is Unmaximized or temporarily Invisible, we can force reset to run again.
But the Unity API doesn't provide developers with enough information about this, so we didn't have enough information about the state of the editor.
It even passed an invalid state value.
In fact, in our "Maximize > Unmaximize test", the "docked" state value was passed as false (!) right before the error occurred. (Of course, docking was maintained, and AnyPortrait editor was forcibly terminated afterwards.)
As a result, both methods of (1) monitoring data that can be deleted on docking or (2) writing docking-related events and validation code are currently impossible.
Our team, like other developers, has to rely on the API provided by Unity, which has yet to give us a proper solution.
In Unity 2020.1 - it's very late! -, Unity started providing "docked" information in the editor, and our team hopes that Unity will provide more information and events to developers.
It's really very sad that we can't fix this issue yet, and if a completely different approach that we haven't tried comes up on the forums, we'll be happy to try it.
We will continue to monitor this issue.