@yuneta/gobj-js 7.8.0 → 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) {
@@ -6063,7 +6063,7 @@ function ac_on_message(gobj, event, kw, src) {
6063
6063
  let msg_type = msg_iev_get_msg_type(gobj, iev_kw);
6064
6064
  let event_id = msg_iev_get_stack(gobj, iev_kw, IEVENT_STACK_ID);
6065
6065
  let iev_dst_role = kw_get_str(gobj, event_id, "dst_role", "");
6066
- if (iev_dst_role !== gobj_yuno_role()) {
6066
+ if (iev_dst_role.toLowerCase() !== gobj_yuno_role().toLowerCase()) {
6067
6067
  log_error(`"It's not my role, dst_role: ${iev_dst_role}, my_role: ${gobj_yuno_role()}`);
6068
6068
  return 0;
6069
6069
  }