Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IovCollection fails creation after destroying it #26

Open
ricardojbertolin opened this issue Oct 20, 2020 · 1 comment
Open

IovCollection fails creation after destroying it #26

ricardojbertolin opened this issue Oct 20, 2020 · 1 comment

Comments

@ricardojbertolin
Copy link

The following code generates an exception:

        const videoElement = this.elRef.nativeElement.firstElementChild;
        let iovCollection: IovCollection;
        // define a function that instantiates an IovCollection, and creates an iov
        const createIov = async () => {
            iovCollection = IovCollection.asSingleton();
            console.log(iovCollection);
            const iov = await iovCollection.create({ videoElement } as any);
            await iov.changeSrc(url);
        };
        // create iov
        await createIov();
        // destroy it after creation
        await iovCollection.destroy();
        // create again
        await createIov();

Basically it does the following:

  • Instantiate a IovCollection and create a iov
  • After that destroy the iovCollection
  • Try to create again

This is the exception generated:

image

The excepction is caused by this.:

image

@ricardojbertolin
Copy link
Author

More information. The console.log in the code above, the first time outputs the following:

{
  "logId": "0",
  "isDestroyed": false,
  "isDestroyComplete": false,
  "logColor": "black",
  "logger": {
    "logLevel": 0,
    "prefix": "IovCollection 0",
    "prefixStyle": "color: black;"
  },
  "iovs": {},
  "pendingRemoval": {}
}

and the second time, after the removal, the output is:

{
  "logId": "0",
  "isDestroyed": true,
  "isDestroyComplete": true,
  "logColor": "black",
  "logger": {
    "logLevel": 0,
    "prefix": "IovCollection 0",
    "prefixStyle": "color: black;"
  },
  "iovs": null,
  "pendingRemoval": null
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant