Commit Graph

1868 Commits

Author SHA1 Message Date
Thaddeus Crews 599f2bd5b9 Merge pull request #118824 from hpvb/fix-118085
Fix a race in `ResourceLoader::load_threaded_request()`
2026-05-06 14:56:33 -05:00
HP van Braam f63ab5fbd9 Fix a race in ResourceLoader::load_threaded_request()
When multiple threads try to load the same sub-resource the
ResourceLoader's anti-deadlock protection thinks that the other threads
loading the dependency are old threads blocked on a dependency.

The current thread will then immediately start to load the sub-resource
since they can't wait for it. This can then lead to multiple threads
loading the same resource concurrently.

We fix the problem by recording in the task when loading has ACTUALLY
started, and if so we simply wait.

This is no worse than before, at the point where we are waiting now we
previously re-started the load entirely.

Tested by running the MRP from the below issue (with and without asan
and msan), and loading and running various public and private Godot
projects.

This also fixes a use-after-free on resource_changed_connections when
multiple threads end up running the same import. This is a pre-existing
bug but this code widened the race window.

This also fixes a pre-existing memory leak in load_threaded_request,
when the user calls the function we capture the Ref<LoadToken> but
immediately drop the ref. Causing the refcount to go to 1. Later in
_run_load_task we unreference manually, bringing the refcount to 0. This
then later prevents the Ref<> from memdeleting the LoadToken.

This fixes #118085
2026-05-05 15:11:05 +02:00
Dimitri Sukhankin e07737e0ba Add better error message when trying to decompress ZSTD with decompress_dynamic 2026-05-04 22:01:06 +04:00
Mikael Hermansson 6103c0bc42 Add error to error messages in FileAccessPack 2026-04-29 18:43:04 +02:00
bucket 9e674ece11 fix shortened ipv6 parsing 2026-04-21 15:18:46 +02:00
Thaddeus Crews f1edeb4acc Merge pull request #118527 from KoBeWi/ignore_error_problem_fixed
Don't print UID errors when cache is not initialized
2026-04-18 07:28:36 -05:00
Kaleb Reid f973e3e346 Remove p_ and add r_ prefixes to argument names 2026-04-15 13:47:15 -07:00
Thaddeus Crews 8d80b74623 Merge pull request #118514 from bruvzg/be
Remove unused and broken big endian support code.
2026-04-13 11:46:02 -05:00
Thaddeus Crews 5adbdac72b Merge pull request #117025 from brandonhare/fix-imported-resource-script-class
Fix quick load for resources imported by editor import plugins
2026-04-13 11:45:57 -05:00
kobewi 14568256a3 Don't print UID errors when cache is not initialized 2026-04-13 18:43:58 +02:00
Pāvels Nadtočajevs cdd274199e Remove unused and broken big endian support code. 2026-04-13 12:41:46 +03:00
Thaddeus Crews 803c6df71a Merge pull request #117800 from allenwp/exr-clipping
Add support for saving HDR screenshots to `Image.save_exr` functions.
2026-04-01 18:10:16 -05:00
Thaddeus Crews 656a268688 Merge pull request #117010 from bruvzg/voll_name_win
[Windows] Show drive names in file dialog.
2026-03-30 13:35:34 -05:00
Allen Pestaluky 2b9cea5f87 Add support for saving HDR screenshots to Image.save_exr functions. 2026-03-27 11:20:06 -04:00
StarryWorm 9ffc7d9f99 Split CacheMode from ResourceFormatLoader 2026-03-27 07:16:20 -04:00
StarryWorm d610492fef Separate ResourceFormat* methods from main classes 2026-03-27 07:16:20 -04:00
Michael Alexsander c766fb1ce8 Create a proper editor for MeshLibrary 2026-03-21 11:16:26 -03:00
Lukas Tenbrink 05c33acbb1 Make memnew(RefCounted) return Ref, to force callers to take ownership of it through a reference. 2026-03-18 20:34:08 +01:00
Rémi Verschelde 4336184ea4 Style: Tweak ordering of thirdparty includes with angle brackets 2026-03-18 10:41:59 +01:00
Rémi Verschelde 98868393cc Style: Enforce #include validation hook 2026-03-18 10:41:59 +01:00
Rémi Verschelde e33e98a26f Style: Apply clang-format grouping rules 2026-03-17 20:11:01 +01:00
passivestar 9d68328a6d Filter out metadata of excluded files on export 2026-03-16 17:48:44 +04:00
Lukas Tenbrink efcc97ee8a Move enum registration from ClassDB / ClassInfo to GDType.
Create caches across supertypes for faster lookup.
2026-03-13 19:20:30 +01:00
Pāvels Nadtočajevs fdda64e59e Handle UID path in packs. 2026-03-11 18:46:53 +02:00
Rémi Verschelde e015e8bde4 Remove unused includes in core with clangd-tidy 2026-03-11 06:41:36 +01:00
Yyf2333 282e4544b0 Split VariantCaster from binder_common.h 2026-03-10 17:59:33 +08:00
Rémi Verschelde 2dd1f4ef60 Decouple node.h from scene_tree.h, minimize its other includes 2026-03-05 13:54:46 +01:00
StarryWorm 3cb2d376f8 Get rid of all unnecessary class_db.h includers 2026-03-04 17:40:05 -05:00
Rémi Verschelde eabb9a63d4 Rename callable_method_pointer.h to callable_mp.h and include it explicitly
This allows removing it from `class_db.h`, significantly reducing the amount of files
that include it transitively.

Also includes some include cleanup in `control.h` and `rich_text_label.h` done while
ensure they don't depend on `callable_mp`.
2026-03-04 16:23:23 +01:00
Rémi Verschelde 765362b033 Explicitly include core/config/engine.h where used 2026-03-04 10:17:10 +01:00
Rémi Verschelde f332faf46b Explicitly include core/os/os.h where used 2026-03-04 09:54:10 +01:00
Pāvels Nadtočajevs c46414c44d [Windows] Show drive names in file dialog. 2026-03-03 15:35:58 +02:00
brandonhare d7955e56d7 Fix resource script class for imported resources 2026-03-04 00:33:36 +11:00
StarryWorm 357fa00a4a rm class_db.h from resource.h 2026-02-27 19:08:29 -05:00
Thaddeus Crews abdde1b69d Core: Remove class_db.h include from ref_counted.h 2026-02-26 18:14:23 -06:00
Thaddeus Crews e380a41752 Style: Add class_db.h includes explicitly 2026-02-26 15:50:28 -06:00
Jules 8cf4c5d9b2 Fix multithreaded load status progress 2026-02-24 09:23:26 +01:00
Mikael Hermansson f21053e4ef Allow providing Android APK/AAB as base packs for patch PCKs 2026-02-23 14:26:52 +01:00
Lukas Tenbrink a6adb12240 Remove message_queue.h include from object.h. 2026-02-20 00:27:41 +01:00
Lukas Tenbrink 0ea5ece984 Move binary math functions to Math namespace in math_funcs_binary header. 2026-02-17 12:24:35 +01:00
Thaddeus Crews 1e12317895 Merge pull request #115646 from Ivorforce/list-explicit-copy
Change `List` copy constructor from implicit to explicit.
2026-02-16 15:02:34 -06:00
Thaddeus Crews b151a2d966 Merge pull request #115396 from DeeJayLSP/faster-uid-path-2
Prevent unnecessary memory allocations when reading UID cache
2026-02-16 15:02:31 -06:00
Thaddeus Crews bf95b62586 Merge pull request #115883 from Gurvan/master
Make JSON.stringify use compact representation for empty `Dictionary`
2026-02-13 07:40:28 -06:00
DeeJayLSP 4c05d9ae01 Prevent unnecessary memory allocations when reading UID cache 2026-02-12 20:00:10 -03:00
Mikael Hermansson bfcd9be90d Zero out padding in NodePath serialization 2026-02-09 18:23:02 +01:00
Thaddeus Crews 7dae5da198 Style: Convert *.gen.inc to *.gen.h 2026-02-05 19:47:56 -06:00
Thaddeus Crews 79eb6694a1 Merge pull request #112381 from Ivorforce/no-right-align
Don't right-align escaped newlines (e.g. for `#define`)
2026-02-05 09:18:36 -06:00
Gurvan d234d954f7 Modify JSON.stringify so that it doesn't create unnecessary empty lines from empty dictionaries 2026-02-04 23:54:57 +01:00
Lukas Tenbrink c5df0cb82b Don't right-align escaped newlines, e.g. for #define. This has previously led to long diffs in the commit history. 2026-02-04 19:31:28 +01:00
Thaddeus Crews d9089dba06 Merge pull request #110254 from BlueCube3310/resize-all-formats
Image: Support resizing all uncompressed formats
2026-02-03 18:06:42 -06:00