Commit 6ac175f
committed
Fix bugs in examples and electron demos (#1414)
This PR fixes small but user-facing issues in the JavaScript examples and Electron demos, improving correctness of sample code and shutdown/cleanup behavior.
**Changes:**
**example/topics/publisher/publisher-qos-example.js**
- Fix typo `qos.hitory` → `qos.history`; the misspelled property silently created a non-existent field, so the history policy was never actually configured
**example/actions/action_client/action-client-example.js**
- Fix undefined variable `status` → `goalHandle.status` in the goal failure log message; the original code would throw a `ReferenceError` when a goal failed
**electron_demo/manipulator/main.js**
- Fix resource leak: store the publishing `setInterval` return value in `publishingInterval` and clear it on app shutdown; previously the interval ID was discarded, making cleanup impossible
**electron_demo/turtle_tf2/main.js**
- Fix incorrect `rclnodejs.shutdown()` usage: call it once globally instead of once per node in a `forEach` loop; `shutdown()` tears down the entire ROS2 context, so calling it multiple times risks context corruption
Fix: #14131 parent 80b0653 commit 6ac175f
4 files changed
Lines changed: 20 additions & 19 deletions
File tree
- electron_demo
- manipulator
- turtle_tf2
- example
- actions/action_client
- topics/publisher
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
82 | 86 | | |
83 | 87 | | |
84 | 88 | | |
| |||
131 | 135 | | |
132 | 136 | | |
133 | 137 | | |
134 | | - | |
| 138 | + | |
135 | 139 | | |
136 | 140 | | |
137 | 141 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
759 | 759 | | |
760 | 760 | | |
761 | 761 | | |
762 | | - | |
763 | | - | |
764 | | - | |
765 | | - | |
766 | | - | |
767 | | - | |
768 | | - | |
769 | | - | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
770 | 767 | | |
771 | 768 | | |
772 | 769 | | |
773 | 770 | | |
774 | 771 | | |
775 | | - | |
776 | | - | |
777 | | - | |
778 | | - | |
779 | | - | |
780 | | - | |
781 | | - | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
782 | 777 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
0 commit comments