asmagill / hs._asm.axuielement

Accessing Accessibility Objects with Hammerspoon
34 stars 2 forks source link

asHSWindow() Crashes #4

Closed latenitefilms closed 7 years ago

latenitefilms commented 7 years ago

FYI: I can fairly consistently get Hammerspoon to crash with the following code:

local elementUnderMouse = ax.systemElementAtPosition(mouse.getAbsolutePosition())
if elementUnderMouse ~= nil then print(elementUnderMouse:asHSWindow()) end

I'm assuming you already have all my crash logs!

asmagill commented 7 years ago

The AXRef was getting released twice during garbage collection... the hs.window code I had linked to doesn't do an explicit retain and I had missed this in my initial tests. The latest update should fix it for you.

latenitefilms commented 7 years ago

Legend, thank you! Will test out!