Commit 0507d6c
committed
fix(rbx): lock services against ClearAllChildren and reparenting too
Completes the service-singleton protection from 36d36c0: the verification pass noted two
remaining same-class paths a mod could use to detach/destroy a shared service.
- Instance.Parent setter refuses protected singletons (services/Camera) — Roblox locks a
service's Parent; reparenting/nil-ing it would detach it so game:GetService stops resolving it.
- game:ClearAllChildren() destroys only non-protected children, leaving services/Camera intact
(GetChildren is a snapshot, so destroying while iterating is safe).
Test extended: reparenting a service errors and ClearAllChildren leaves it resolvable.
CoreAI.Mods.Tests 660/660 green.1 parent 36d36c0 commit 0507d6c
3 files changed
Lines changed: 30 additions & 5 deletions
File tree
- Assets
- CoreAIMods
- Runtime/Scripting/LuaCs
- Tests/EditMode/RbxApi/LuaBindings
- CoreAI
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
| |||
Lines changed: 20 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
183 | 192 | | |
184 | 193 | | |
185 | 194 | | |
| |||
307 | 316 | | |
308 | 317 | | |
309 | 318 | | |
310 | | - | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
311 | 330 | | |
312 | 331 | | |
313 | 332 | | |
| |||
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
413 | 413 | | |
414 | 414 | | |
415 | 415 | | |
416 | | - | |
| 416 | + | |
417 | 417 | | |
418 | | - | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
419 | 423 | | |
420 | 424 | | |
421 | 425 | | |
| |||
0 commit comments