Search Issue Tracker
Duplicate
Votes
14
Found in
2019.4
2020.3
2021.3
2021.3.2f1
2022.1
2022.2
Issue ID
1426900
Regression
No
Error "Destroy may not be called from edit mode! Use DestroyImmediate instead." is shown when exiting Play Mode
How to reproduce:
1. Open the attached project "UIToolTip"
2. Click Play
3. Click Play again to exit Play Mode
4. Observe the Console
Expected result: Console shows no errors
Actual result: Console shows "Destroy may not be called from edit mode! Use DestroyImmediate instead." error
Reproduced in: 2019.4.38f1, 2020.3.33f1, 2021.3.1f1, 2022.1.0b16, 2022.2.0a15
Reproduced on: Windows 11 Pro
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Undoing the branch rotation resets only wireframe and not mesh when undoing the action first time after launching the project
- Asset Bundles retain their previous hash and CRC values when an object within a bundle is changed and rebuilt
- APV Reflection Probe Normalization breaks when SSGI is enabled
- Default Custom Components in project have Library counterparts
- [iOS]"The destination host has an erroneous SSL certificate" error is thrown when using UnityWebRequest to connect to the server with a self-signed certificate
sugiharam2
Mar 10, 2024 03:47
When I tried downgrading the InputSystem version, the error disappeared.
Unity 2023.2.13f1
Input System 1.7.0 > error
Input System 1.6.3 > error
Input System 1.5.0 > no error
Don't use Input System > no error
berber_hunter
Dec 29, 2023 17:24
This is not resolved!!!!
Pchan_Cegepdefi
Dec 11, 2022 07:31
[Solution] I had the same problem. I double clicked on the error message and the script "EventSystem.cs" opened at line #413. The error said "Use DestroyImmediate instead". So I replace the line "panel.destroyed += () => Destroy(go);" TO "panel.destroyed += () => DestroyImmediate(go);"
bilalakil
Oct 03, 2022 00:00
Also looking for the duplicate ticket so I can vote on it. Note that this bug prevents some build attempts from succeeding.
generatedgoblin
Aug 12, 2022 13:10
Can't find the duplicate, can this be re-opened?
severeZzz
Jun 14, 2022 17:35
Could you please add a link to the original ticket? "Duplicate" is not informative.