@yuneta/gobj-js 7.8.7 → 7.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1131,6 +1131,14 @@ function gobj_destroy(gobj) {
1131
1131
  return;
1132
1132
  }
1133
1133
  if (gobj.__refs__ > 0) log_error(`${gobj_short_name(gobj)}: gobj DESTROYING with references: ${gobj.__refs__}`);
1134
+ if (gobj.playing) {
1135
+ log_error(`Destroying a PLAYING gobj: ${gobj_full_name(gobj)}`);
1136
+ gobj_pause(gobj);
1137
+ }
1138
+ if (gobj.running) {
1139
+ log_error(`Destroying a RUNNING gobj: ${gobj_full_name(gobj)}`);
1140
+ gobj_stop(gobj);
1141
+ }
1134
1142
  gobj.obflag |= obflag_t.obflag_destroying;
1135
1143
  let trace_creation = __yuno__ && gobj_read_bool_attr(__yuno__, "trace_creation");
1136
1144
  if (trace_creation) trace_machine(sprintf("💔💔⏩ destroying: %s", gobj_full_name(gobj)));
@@ -1140,14 +1148,6 @@ function gobj_destroy(gobj) {
1140
1148
  parent.gclass.gmt.mt_child_removed(parent, gobj);
1141
1149
  }
1142
1150
  if (gobj.gobj_flag & gobj_flag_t.gobj_flag_service) _deregister_service(gobj);
1143
- if (gobj.playing) {
1144
- log_error(`Destroying a PLAYING gobj: ${gobj_full_name(gobj)}`);
1145
- gobj_pause(gobj);
1146
- }
1147
- if (gobj.running) {
1148
- log_error(`Destroying a RUNNING gobj: ${gobj_full_name(gobj)}`);
1149
- gobj_stop(gobj);
1150
- }
1151
1151
  gobj_unsubscribe_list(gobj, gobj.dl_subscriptions, true);
1152
1152
  gobj_unsubscribe_list(gobj, gobj.dl_subscribings, true);
1153
1153
  if (parent) {