Skip to content

Commit

Permalink
1.36.1 setTracksListner guard clause
Browse files Browse the repository at this point in the history
Make sure state/tracks/track is available before setting, guard against possible race conditions.
  • Loading branch information
MikalDev committed Feb 7, 2021
1 parent 8ed1a0f commit 1b2a3b1
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 3 deletions.
Binary file added dist/Spine-v1.36.1.c3addon
Binary file not shown.
2 changes: 1 addition & 1 deletion src/addon.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "plugin",
"name": "Spine",
"id": "Gritsenko_Spine",
"version": "1.36.0",
"version": "1.36.1",
"author": "Mikal and Igor Gritsenko",
"website": "https://gritsenko.github.io/c3_spine_plugin",
"documentation": "https://gritsenko.github.io/c3_spine_plugin",
Expand Down
2 changes: 2 additions & 0 deletions src/c3runtime/instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,8 @@

setTrackListeners(state, trackIndex)
{
if (!state || !state.tracks || !state.tracks[trackIndex]) {if(this.debug) {console.warn('[Spine] setTrackListners invalid', state, trackIndex)};return};

state.tracks[trackIndex].listener = {
complete: (trackEntry, count) => {
this.completeAnimationName = this.trackAnimations[trackEntry.trackIndex];
Expand Down
2 changes: 1 addition & 1 deletion src/c3runtime/spine-draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,6 @@ class SpineBatch {

if (!globalThis.spineBatcher)
{
console.log('[Spine] SpineBatcher init, 1.36.0');
console.log('[Spine] SpineBatcher init, 1.36.1');
globalThis.spineBatcher = new SpineBatch();
}
2 changes: 1 addition & 1 deletion src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const C3 = self.C3;

const PLUGIN_ID = "Gritsenko_Spine";
const PLUGIN_VERSION = "1.36.0";
const PLUGIN_VERSION = "1.36.1";
const PLUGIN_CATEGORY = "general";

const PLUGIN_CLASS = SDK.Plugins.Gritsenko_Spine = class SpinePlugin extends SDK.IPluginBase {
Expand Down

0 comments on commit 1b2a3b1

Please sign in to comment.