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

Support multiple CNI configuration directories #176

Merged
merged 1 commit into from
Apr 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ Notes:
* `Tween.remove` is a new method that immediately removes the Tween from the TweenManager, regardless of what state the tween is in. Once called the tween will no longer exist within any internal TweenManager arrays.
* `SceneManager.isPaused` is a new method that will return if the given Scene is currently paused or not (thanks @samme)
* `ScenePlugin.isPaused` is a new method that will return if the given Scene is currently paused or not (thanks @samme)
* `TextureManager.removeKey` is a new method that will remove a key from the Texture Manager without destroying the texture itself.

### Updates

Expand All @@ -73,6 +74,7 @@ Notes:
* The `Clock.now` property value is now synced to be the `TimeStep.time` value when the Clock plugin boots and is no longer `Date.now()` until the first update (thanks @Antriel)
* `Graphics.strokePoints` has renamed the second argument from `autoClose` to `closeShape`. There is also a new third argument `closePath`, which defaults to `true` and automatically closes the path before stroking it. The `endIndex` argument is now the fourth argument, instead of the third.
* `Graphics.fillPoints` has renamed the second argument from `autoClose` to `closeShape`. There is also a new third argument `closePath`, which defaults to `true` and automatically closes the path before filling it. The `endIndex` argument is now the fourth argument, instead of the third.
* Calling `Texture.destroy` will now call `TextureManager.removeKey` to ensure the key is removed from the manager, should you destroy a texture directly, rather than going via `TextureManager.remove`. Fix #4461 (thanks @BigZaphod)

### Bug Fixes

Expand Down
3 changes: 3 additions & 0 deletions src/textures/Texture.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,9 @@ var Texture = new Class({
this.source = [];
this.dataSource = [];
this.frames = {};

this.manager.removeKey(this.key);

this.manager = null;
}

Expand Down
22 changes: 20 additions & 2 deletions src/textures/TextureManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,6 @@ var TextureManager = new Class({
// By this point key should be a Texture, if not, the following fails anyway
if (this.list.hasOwnProperty(key.key))
{
delete this.list[key.key];

key.destroy();

this.emit(Events.REMOVE, key.key);
Expand All @@ -223,6 +221,26 @@ var TextureManager = new Class({
return this;
},

/**
* Removes a key from the Texture Manager but does not destroy the Texture that was using the key.
*
* @method Phaser.Textures.TextureManager#removeKey
* @since 3.17.0
*
* @param {string} key - The key to remove from the texture list.
*
* @return {Phaser.Textures.TextureManager} The Texture Manager.
*/
removeKey: function (key)
{
if (this.list.hasOwnProperty(key))
{
delete this.list[key];
}

return this;
},

/**
* Adds a new Texture to the Texture Manager created from the given Base64 encoded data.
*
Expand Down