Thread Tools Display Modes
03/02/16, 02:03 PM   #1
votan
 
votan's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 577
Minor leak in CALLBACK_MANAGER

Hi Chip,

I have found something one of ZOS may look at some day:
Everytime you interact with a crafting station (except Alchemy) the number of registered callbacks of CraftingAnimationsStopped increases and does not decrease afterwards.

Tested without any addon, of course.

Code:
/script d(#CALLBACK_MANAGER.callbackRegistry["CraftingAnimationsStopped"])
Starting at 69. Go to crafting station, interact, close, 70, interact, close, 71, ...

The only station not affected is Alchemy.

This can't be good, but one has to interact a lot with crafting stations without reloading, so...
  Reply With Quote
03/02/16, 03:00 PM   #2
Wandamey
Guest
Posts: n/a
we could use a forum section for possible ESO/API bug reports too.

I had some troubles picking a subforum not long ago about the changes in a number of arguments that may have been overlooked in the gear crafting station, even if so far I've only found errors in addons due to this.

Mmmhhh I should have posted in the "site & forum" forum section, but it would have lacked of context

so while I'm at it, something else to report :
Idk if full style books items are really a thing or a legend but in any case : IsItemLinkBookKnown(itemLink) doesn't work with the full motif.


(sorry to derail your topic, votan )
  Reply With Quote
03/02/16, 03:13 PM   #3
votan
 
votan's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 577
Minor leak in CALLBACK_MANAGER (PTS)

At PTS the number of registered callbacks starts at 70, but the issue is still there.

Originally Posted by Wandamey View Post
(sorry to derail your topic, votan )
No problem, Wandamey
  Reply With Quote
03/02/16, 03:24 PM   #4
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
Originally Posted by Wandamey View Post
we could use a forum section for possible ESO/API bug reports too.
I used the Wish List section for those.
  Reply With Quote
03/03/16, 07:16 AM   #5
Wandamey
Guest
Posts: n/a
Is the OP being investigated on PTS right now? Because I swear I just saw "OnSelectedPatternChanged" not triggering anymore since 10-15 min ago. I thought I mistype something, and replaced my file with the one working and uploaded here and still no debug output for

ZO_PreHook(ZO_Smithing,"OnSelectedPatternChanged", MyCustomFunction)

reloadui, unlog relog does nothing, I've compared the 2 files I had when it got boggus and found nothing "game breaking" (hahaha)

I suppose I'll check that later with more coffee in my belly but... weird.
If someone can throw a fresh pair of eyes on this please, I could avoid a coffein OD. Thanks.


hmmm... now its back... but I've deactivated all other addons. checking that again to find the culprit.
edit 2 : loaded the same set of addons that's definitively an addon conflict. sry.
edit 3 : relieved... it's not of of mine

Edit 4: yet it's a set of addons that I saved 2 or 3 days ago and it was working fine till today. Could be related to the issue above afaik.

OK that would be the old slider version of MultiCraft that broke it mysteriously around one hour ago :confused
re re edit... ah nuuh i know, i was on another char that usual, and my keybind for reloadui didn't work so i loaded my usual addon set to this char right before I re-checked the station for the second time today. But still, i'm pretty sure it was working yesterday on my usual char.
all of this to move a control of 2 UI units. /facepalm.

checking with the new version to see if all is good when up to date.

Edit : nope, still broken with MultiCraft v3.

Note to Ayantir : I see in your file that you reset the spinner with OnSelectedPatternChanged and rewrite the function for this. Just to be sure, OnSelectedPatternChanged triggers everytime any of the composant are selected to update the tooltip icon/info etc... not just the "pattern" pattern.
Looks kind of a bit overkill to me, or it is wanted? Anyway it breaks the prehook now, idk why, how, if it's a bug or if it'll stay like that. Afaik my addon QuickLeather is probably the only one using that prehook for now so if you have any advice...

Adding QuickLeather as OptionalDependsOn in MultiCraft manifest seems to work. But it doesn't look like a perfect solution at all. I'd rather have something to do on my end.

I should be able to transform my prehook into a posthook like you did, but that wouldn't solve that broken callback issue for other addons which would need it.

Last edited by Wandamey : 03/03/16 at 09:04 AM.
  Reply With Quote
03/03/16, 09:29 AM   #6
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
Originally Posted by Wandamey View Post
ZO_PreHook(ZO_Smithing,"OnSelectedPatternChanged", MyCustomFunction)
You're hooking the function in the class table. If another add-on hooks that function in the instance table BEFORE you do this, your hook will never run on the INSTANCE with earlier hook. It's generally better, and definitely less error-prone, to hook functions in instance tables. That way there's no quarrel who runs first, and everyone can call the original ZOS function if needs be.
  Reply With Quote
03/03/16, 09:39 AM   #7
Wandamey
Guest
Posts: n/a
Originally Posted by merlight View Post
You're hooking the function in the class table. If another add-on hooks that function in the instance table BEFORE you do this, your hook will never run on the INSTANCE with earlier hook. It's generally better, and definitely less error-prone, to hook functions in instance tables. That way there's no quarrel who runs first, and everyone can call the original ZOS function if needs be.
I have no idea what you just said, I can only guess that I'll have to try to replace ZO_Smithing with the table Ayantir uses?
Oww, just saw... I mistook PreHook for PreHookHandler and looked for a control (translated by "anything with ZO_" in my little head) instead of a table no idea how it worked till today then. Thanks for the explaining. I'll give it a try.

Mmmh and I got another one to replace : ZO_SmithingCreation for "OnFilterChanged" function, if someone knows what table it is before I find it, don't hesitate to spoil it to me


OK seems to work perfectly with SMITHING and SMITHING.creationPanel , no idea how i did not try that at all the first time. But that's nice, i've learnt something today.

Last edited by Wandamey : 03/03/16 at 10:34 AM.
  Reply With Quote
03/03/16, 10:29 AM   #8
ZOS_ChipHilseberg
ZOS Staff!
Premium Member
Yes this person is from ZeniMax!
Join Date: Oct 2014
Posts: 551
Originally Posted by votan View Post
Hi Chip,

I have found something one of ZOS may look at some day:
Everytime you interact with a crafting station (except Alchemy) the number of registered callbacks of CraftingAnimationsStopped increases and does not decrease afterwards.

Tested without any addon, of course.

Code:
/script d(#CALLBACK_MANAGER.callbackRegistry["CraftingAnimationsStopped"])
Starting at 69. Go to crafting station, interact, close, 70, interact, close, 71, ...

The only station not affected is Alchemy.

This can't be good, but one has to interact a lot with crafting stations without reloading, so...
We tracked down the bug and fixed it.
  Reply With Quote
03/03/16, 11:12 AM   #9
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
Originally Posted by Wandamey View Post
I have no idea what you just said, I can only guess that I'll have to try to replace ZO_Smithing with the table Ayantir uses?
SMITHING, that's the instance ...
... of class ZO_Smithing, a subclass ...
... of class ZO_Smithing_Common, a subclass ...
... of ZO_Object

When SMITHING:OnSelectedPatternChanged() is called, Lua looks for "OnSelectedPatternChanged" key
first in the "self" table you called it on -> SMITHING
if it's not there, it looks in the class -> ZO_Smithing
if it's not there, it looks in the base -> ZO_Smithing_Common
and so on

You can put your hooks anywhere in the hierarchy -- sometimes that's necessary, for example when there are many objects of a class, that are created on the fly, and you want to change the behaviour of all of them, past and future -- you replace methods in the class. But hooks higher in the hierarchy overrule base class hooks (more precisely that's because of how ZO_PreHook works; you could write a hook that honors base class overrides, but nobody does that). For singleton objects that are hooked by various add-ons it's best to hook on the singleton, highest level, so that your hooks aren't overruled.
  Reply With Quote
03/03/16, 11:33 AM   #10
Wandamey
Guest
Posts: n/a
Originally Posted by merlight View Post
SMITHING, that's the instance ...
... of class ZO_Smithing, a subclass ...
... of class ZO_Smithing_Common, a subclass ...
... of ZO_Object

When SMITHING:OnSelectedPatternChanged() is called, Lua looks for "OnSelectedPatternChanged" key
first in the "self" table you called it on -> SMITHING
if it's not there, it looks in the class -> ZO_Smithing
if it's not there, it looks in the base -> ZO_Smithing_Common
and so on

You can put your hooks anywhere in the hierarchy -- sometimes that's necessary, for example when there are many objects of a class, that are created on the fly, and you want to change the behaviour of all of them, past and future -- you replace methods in the class. But hooks higher in the hierarchy overrule base class hooks (more precisely that's because of how ZO_PreHook works; you could write a hook that honors base class overrides, but nobody does that). For singleton objects that are hooked by various add-ons it's best to hook on the singleton, highest level, so that your hooks aren't overruled.
When I think I was happy to just not have a nil error for the function I wanted to pick

I think I get it, if what you call "higher" in the hierarchy is the first checked? otherwise i may need to sleep on it. Like a whole year.
For now i'll just stick to this : "try a table first".
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Minor leak in CALLBACK_MANAGER

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off