Skip to content

Commit 6172851

Browse files
committed
Disable freeing dynamic methods only when eventpipe is enabled
1 parent 0e830e7 commit 6172851

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/mono/mono/metadata/loader.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include <mono/metadata/loader-internals.h>
3737
#include <mono/metadata/class-init.h>
3838
#include <mono/metadata/class-internals.h>
39+
#include <mono/metadata/components.h>
3940
#include <mono/metadata/debug-helpers.h>
4041
#include <mono/metadata/reflection.h>
4142
#include <mono/metadata/profiler-private.h>
@@ -1371,6 +1372,11 @@ mono_free_method (MonoMethod *method)
13711372

13721373
MONO_PROFILER_RAISE (method_free, (method));
13731374

1375+
// EventPipe might require information about methods to be stored throughout
1376+
// entire app execution, so stack traces can be resolved at a later time.
1377+
if (mono_component_event_pipe ()->component.available ())
1378+
return;
1379+
13741380
if (method->signature) {
13751381
/*
13761382
* FIXME: This causes crashes because the types inside signatures and

0 commit comments

Comments
 (0)