LiteNetLib4Mirror icon indicating copy to clipboard operation
LiteNetLib4Mirror copied to clipboard

'NetworkConnection' does not contain a definition for 'Dispose'

Open jjantschulev opened this issue 5 years ago • 2 comments

The Exact Error Message is:

Assets/Mirror/Runtime/Transport/LiteNetLib4Mirror/LiteNetLib4MirrorNetworkManager.cs(139,18): error CS1061: 'NetworkConnection' does not contain a definition for 'Dispose' and no accessible extension method 'Dispose' accepting a first argument of type 'NetworkConnection' could be found (are you missing a using directive or an assembly reference?)

I just imported the latest version of LiteNetLib4Mirror (1.2.8). I also imported the latest version of Mirror(5.0.2).

For the moment I have removed this line, and everything seems to work, but i dont know if that might lead to a memory leak or other unintended side effect.

jjantschulev avatar Nov 30 '19 07:11 jjantschulev

Mirror recently changed NetworkConnection to no longer implement the IDisposable interface and instead just clean up directly on disconnection (see https://github.com/vis2k/Mirror/pull/1179), so LiteNetLib4MirrorNetworkManager should just need to call conn.Disconnect(); now.

robinnorth avatar Dec 02 '19 16:12 robinnorth

This Mirror change was reverted recently (see https://github.com/vis2k/Mirror/commit/4cc4279d7ddeaf61fe300b3dc420143e63942f1f), so this issue can be closed once the transport is updated to work with the latest Mirror release (7.2.1 at the time of writing). I have made a PR for that: #16

robinnorth avatar Jan 23 '20 12:01 robinnorth