# Dispose() implementation

**URL:** https://discourse.processing.org/t/dispose-implementation/1899
**Category:** Coding Questions
**Created:** [July 19, 2018, 11:10am UTC](https://discourse.processing.org/t/dispose-implementation/1899 "2018-07-19T11:10:53Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Manuel](https://avatars.discourse-cdn.com/v4/letter/m/67e7ee/32.png) [@Manuel](https://discourse.processing.org/u/Manuel)
#### Post date: [July 19, 2018, 11:10am UTC](https://discourse.processing.org/t/dispose-implementation/1899/1 "2018-07-19T11:10:53Z")

</div>

Hi, I’m currently using in my proyect a library that provides a dispose() method that I believe right now is never called, I instantiate objects of that library within the classes on my sketch, so I don’t know how exactly to call that dispose handler.  
Shall I provide my classes with a dispose() method that calls the dispose handler of the objects belonging to that library; and register the dispose() method of my classes into PApplet by passing a reference to PApplet into the constructors of the classes and call PApplet.registerDispose(this);?  
Is PApplet static (surely not) so that I can avoid passing it’s reference on the class constructor?

Thanks!
