# weakRef within custom methods

**URL:** <https://forum.inductiveautomation.com/t/weakref-within-custom-methods/67581>\
**Category:** Ignition\
**Tags:** ignition81, vision, scripting\
**Created:** [December 13, 2022, 9:08pm UTC](https://forum.inductiveautomation.com/t/weakref-within-custom-methods/67581 "2022-12-13T21:08:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gdube](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/gdube/32/41701_2.png) [@gdube](https://forum.inductiveautomation.com/u/gdube)\
**Post date:** [December 13, 2022, 9:08pm UTC](https://forum.inductiveautomation.com/t/weakref-within-custom-methods/67581/1 "2022-12-13T21:08:52Z")

</div>

Hi guys,  
Does anyone know why a weakref created within an extension or custom method always return None, but not within an Event, such as 'actionPerformed' in the screenshot below?

I'm just wondering...

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/b/4bcff846f17f1626920ea55dbe2968c12d398698.png)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [December 13, 2022, 9:30pm UTC](https://forum.inductiveautomation.com/t/weakref-within-custom-methods/67581/2 "2022-12-13T21:30:39Z")

</div>

It's hard to say for sure without diving all the way in, but this is likely just because of the nature of the different lifecycles here. The component is long-lived, and the component events are likely handled by a script environment 'attached' to the component, but the extension functions are compiled ad-hoc and not attached to any existing lifecycle.

---

<div class="post-metadata">

**Author:** ![gdube](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/gdube/32/41701_2.png) [@gdube](https://forum.inductiveautomation.com/u/gdube)\
**Post date:** [December 13, 2022, 9:50pm UTC](https://forum.inductiveautomation.com/t/weakref-within-custom-methods/67581/3 "2022-12-13T21:50:30Z")

</div>

Ah! Well at least it's a satisfying explanation, thank you.
