Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
camargo committed Mar 4, 2017
1 parent f2a4ce1 commit 268a38c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/GlPlot2dComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import { GlPlot2dComponentProps,
* @extends {skate.Component<GlPlot2dComponentProps>}
*/
export class GlPlot2dComponent extends skate.Component<GlPlot2dComponentProps> {
private gl: WebGLRenderingContext | null; // WebGL Context.
private canvas: HTMLCanvasElement | null; // Canvas element we render to.
private gl: WebGLRenderingContext | null; // WebGL Context.
private plot: any | null; // Plot object via gl-plot2d.
private spikes: any | null; // Spikes object via gl-spikes2d.

Expand Down Expand Up @@ -152,12 +152,17 @@ export class GlPlot2dComponent extends skate.Component<GlPlot2dComponentProps> {

/**
* Function that is called after the element has been removed from the document.
* Items are destroyed in the reverse-order from which they are initialized.
*
* @memberOf GlPlot2dComponent
*/
public disconnectedCallback(): void {
super.disconnectedCallback();

if (this.spikes) {
this.spikes.dispose();
}

if (this.plot) {
this.plot.dispose();
}
Expand Down

0 comments on commit 268a38c

Please sign in to comment.