PluginMenu question

so theres this method right here, called Clear. my question is will all the PluginAction’s triggered connections be disconnected upon calling Clear?

thats all. thank you.

You can use a Signal module to disconnect all connections.

1 Like

so it wont automatically disconnect the connections?

I’ve never made a plugin myself so I can’t really answer your question, however from taking a quick look, yes it should clear the menu.

1 Like

It seems to only clear the connection when the PluginAction’s connected function has not referenced the PluginAction.

what do you mean by that? (thirtychars)

For example, I’ve experimented with some connections and this causes them to persist in memory:

Player.CharacterAdded:Connect(function(char)
print(Player.Name.." has loaded their character!")
end)

I referenced the Player instance. Here’s what the code should be:

PlayerName = Player.Name
Player.CharacterAdded:Connect(function(char)
print(PlayerName.." has loaded their character!")
end)

Note: This memory only persists if the instance is not destroyed correctly. I’m not sure how to check this for the plugin action.

1 Like

i have checked that Clear does not clear its PluginActions but only the menu, the only think i could think of is using ClearAllChildren, will that disconnect it?

Probably. But remember that it only will remain in memory if Destroy isn’t called or it references itself, or it doesn’t reference itself but is not parented to nil.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.