@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.
@@ -1130,6 +1130,14 @@ function gobj_destroy(gobj) {
1130
1130
  return;
1131
1131
  }
1132
1132
  if (gobj.__refs__ > 0) log_error(`${gobj_short_name(gobj)}: gobj DESTROYING with references: ${gobj.__refs__}`);
1133
+ if (gobj.playing) {
1134
+ log_error(`Destroying a PLAYING gobj: ${gobj_full_name(gobj)}`);
1135
+ gobj_pause(gobj);
1136
+ }
1137
+ if (gobj.running) {
1138
+ log_error(`Destroying a RUNNING gobj: ${gobj_full_name(gobj)}`);
1139
+ gobj_stop(gobj);
1140
+ }
1133
1141
  gobj.obflag |= obflag_t.obflag_destroying;
1134
1142
  let trace_creation = __yuno__ && gobj_read_bool_attr(__yuno__, "trace_creation");
1135
1143
  if (trace_creation) trace_machine(sprintf("💔💔⏩ destroying: %s", gobj_full_name(gobj)));
@@ -1139,14 +1147,6 @@ function gobj_destroy(gobj) {
1139
1147
  parent.gclass.gmt.mt_child_removed(parent, gobj);
1140
1148
  }
1141
1149
  if (gobj.gobj_flag & gobj_flag_t.gobj_flag_service) _deregister_service(gobj);
1142
- if (gobj.playing) {
1143
- log_error(`Destroying a PLAYING gobj: ${gobj_full_name(gobj)}`);
1144
- gobj_pause(gobj);
1145
- }
1146
- if (gobj.running) {
1147
- log_error(`Destroying a RUNNING gobj: ${gobj_full_name(gobj)}`);
1148
- gobj_stop(gobj);
1149
- }
1150
1150
  gobj_unsubscribe_list(gobj, gobj.dl_subscriptions, true);
1151
1151
  gobj_unsubscribe_list(gobj, gobj.dl_subscribings, true);
1152
1152
  if (parent) {