Skip to content

Error while invoking destroy on CordovaPlugin instance #195

Open
@SanthoshVasabhaktula

Description

@SanthoshVasabhaktula

Getting the error TypeError: Cannot read property 'release' of null while invoking destroy on CordovaAudioSoundInstance. I was able to debug the issue and figured that the below code is throwing the error inside the destroy() function

this._playbackResource.release();

since the _playbackResource is set to null in the method call this.AbstractSoundInstance_destroy();

I did update the destroy method to the following and it worked fine

    p.destroy = function() {
        // call parent function, then release
        this._playbackResource.pause();
        this._playbackResource.release();
        this.AbstractSoundInstance_destroy();
    };

Is the fix appropriate?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions