Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

c# plugin Collections .NET: Failed to unload assemblies #72435

Closed
dream-young-soul opened this issue Jan 31, 2023 · 1 comment
Closed

c# plugin Collections .NET: Failed to unload assemblies #72435

dream-young-soul opened this issue Jan 31, 2023 · 1 comment

Comments

@dream-young-soul
Copy link

Godot version

4.0 beta16

System information

windows11

Issue description

c# plugin include assembly collection object throws error
QQ截图20230131143627

`#if TOOLS
using Godot;
using System;
using System.Collections.Generic;

[Tool]
public partial class test_plugin : EditorPlugin
{
protected Control _control;
//this__object
protected Dictionary<int, object> _dic_object = new Dictionary<int, object>();

public test_plugin()
{
  

    

}
protected override void Dispose(bool disposing)
{
    
  
    _control = null;
    _dic_object.Clear();
    _dic_object = null;
}
public override void _EnterTree()
{
	// Initialization of the plugin goes here.
}

public override void _ExitTree()
{

}

public override void _EnablePlugin()
{
   
        
    _control = new Control()
    {
        CustomMinimumSize = new Vector2(100, 100)
    };

    _control.AddChild(new Label()
    {
        Text = "hello",
        CustomMinimumSize = new Vector2(100, 100)
    });
    GetEditorInterface().GetEditorMainScreen().AddChild(_control);
        
   
	_MakeVisible(false);

     object script = new Class1();
     string json_data = Newtonsoft.Json.JsonConvert.SerializeObject(script);

    _dic_object.Add(1, Newtonsoft.Json.JsonConvert.DeserializeObject(json_data, typeof(Class1))) ;
}

public override void _DisablePlugin()
{
    base._DisablePlugin();
    _dic_object.Clear();
    GD.Print("_DisablePlugin");

}

public override void _MakeVisible(bool visible)
{
    if (_control == null) return;
    if (visible)
        _control.Show();
    else _control.Hide();
}
public override bool _HasMainScreen()
{
    return true;
}

public override string _GetPluginName()
{
    return "name";
}

}
#endif`

Steps to reproduce

1.enable [test_plugin] plugin
2.disable [test_plugin] plugin
3.changed [new_script.cs] code, rebuild project.

Minimal reproduction project

test_demo.zip

@raulsntos
Copy link
Member

Duplicate of #70026

@raulsntos raulsntos marked this as a duplicate of #70026 Feb 22, 2023
@raulsntos raulsntos closed this as not planned Won't fix, can't repro, duplicate, stale Feb 22, 2023
@github-project-automation github-project-automation bot moved this from To Assess to Done in 4.x Priority Issues Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

2 participants