WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Is anyone able to reproduce this crash bug? (https://www.wowinterface.com/forums/showthread.php?t=59431)

Gello 01-03-23 05:02 PM

Is anyone able to reproduce this crash bug?
 
Is it just me or does showing a frame from within a texture's OnEnter cause anyone else's client to crash to desktop if you /reload?

The following XML creates a small dialog frame with a left and right arrow.
  • The left arrow is a Button and if I put the mouse over it and /reload it reloads the client for me as expected.
  • The right arrow is a Texture and if I put the mouse over it and /reload it reliably 100% crashes to desktop for me. Without the typical crash dialog to type what you're doing and send to Blizzard.
  • If I move the mouse off the right arrow, /reload works just fine.
Code:

<Ui>
    <Frame name="TestCrashBug" parent="UIParent" inherits="DefaultPanelTemplate">
        <Size x="200" y="150"/>
        <Anchors>
            <Anchor point="CENTER"/>
        </Anchors>
        <Frames>
            <Button parentKey="CloseButton" inherits="UIPanelCloseButtonDefaultAnchors"/>
            <!-- if this frame is shown from the TestCrashBug.Texture's OnEnter, /reload will crash the client -->
            <!-- but moving the mouse off the frame so this frame is hidden, /reload will not crash the client -->
            <!-- (this behavior is the same if this frame has a different parent and no anchor/size/contents)-->
            <Frame name="TestCrashBugChild" hidden="true">
                <Size x="140" y="40"/>
                <Anchors>
                    <Anchor point="TOP" x="0" y="-32"/>
                </Anchors>
                <Layers>
                    <Layer level="ARTWORK">
                        <FontString parentKey="Text" inherits="GameFontHighlight" setAllPoints="true"/>
                    </Layer>
                </Layers>
            </Frame>
            <!-- if I /reload when the mouse is over this, reloads fine -->
            <Button parentKey="Button">
                <Size x="50" y="50"/>
                <Anchors>
                    <Anchor point="BOTTOMLEFT" x="20" y="16"/>
                </Anchors>
                <NormalTexture file="Interface\Icons\Misc_ArrowLeft"/>
                <Scripts>
                    <OnEnter>
                        TestCrashBugChild.Text:SetText("/reload now and it may be fine")
                        TestCrashBugChild:Show()
                    </OnEnter>
                    <OnLeave>
                        TestCrashBugChild:Hide()
                    </OnLeave>
                </Scripts>
            </Button>
        </Frames>
        <Layers>
            <Layer level="ARTWORK">
                <!-- if I /reload when mouse is over this, client crashes -->
                <Texture parentKey="Texture" file="Interface\Icons\Misc_ArrowRight">
                    <Size x="50" y="50"/>
                    <Anchors>
                        <Anchor point="BOTTOMRIGHT" x="-16" y="16"/>
                    </Anchors>
                    <Scripts>
                        <OnEnter>
                            TestCrashBugChild.Text:SetText("/reload now and client may crash")
                            TestCrashBugChild:Show()
                        </OnEnter>
                        <OnLeave>
                            TestCrashBugChild:Hide()
                        </OnLeave>
                    </Scripts>
                </Texture>
            </Layer>
        </Layers>
    </Frame>
</Ui>

My other WoW machine is currently dedicated for other purposes and can't test on that one for now.

SDPhantom 01-04-23 08:18 AM

Historically, regions (textures and fontstrings) don't support scripts. Though looking at the UI hierarchy, it appears they now inherit from an object type that does.

Similarly, they do have :SetScript(), :GetScript(), and :HasScript() functions. There's no documentation I'm aware of for their support specifically, so this may warrant some probing around.

Fizzlemizz 01-04-23 09:59 AM

If you comment out the
Code:

TestCrashBugChild:Show()
in the texture OnEnter it doesn't crash so, likely bug.
Edit: If you don't show TestCrashBugChild it seems to work ok but if you show it (or have it shown by default), it will crash even without setting the text.

Gello 01-04-23 12:07 PM

Thanks for testing to confirm. Yeah even if the frame has no user-defined elements (<Frame parentKey="TestCrashBugChild"/>) it seems to crash for me. I can do all sorts of stuff in the OnEnter, but showing another frame seems to cause the crash. And if the frame gets hidden, like in the OnLeave, it seems fine.

I'm very excited to use these new script handler-enabled textures. I hope this bug (and the issues with textures not inheriting script handlers unless any are explicitly defined in XML) are sorted out soon.

One of my addons has an intrinsic button template called RematchCompositeButton that I've been using for some time that makes textures into buttons with their own OnEnter/OnLeave/OnClick behaviors. While the mouse is over a button it periodically checks if the mouse is over a texture in the ARTWORK layer and triggers a callback if the texture was registered for one. (This was to solve a crash issue on Macs due to having too many buttons ontop of buttons in my lists.)

Blizzard's implementation is better since the parent button also gets an OnLeave and such, promoting the textures to actual button/frame behavior. GetMouseFocus() even returns the texture under the mouse instead of the button which is kind of wild.

Fizzlemizz 01-04-23 12:23 PM

I didn't test whether it was the actual frame being shown or just the child FontString (or a combination of the two). I did resize the TestCrashBugChild frame and fontstring to make sure they weren't overlapping the texture with OnEnter/OnLeave when shown but that didn't make a differnce.

Gello 01-06-23 04:37 PM

The crash bug appears fixed on 10.0.5 PTR.

Still problems inheriting texture script handlers, but that's a far less serious issue.


All times are GMT -6. The time now is 03:42 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI