Search Unity

Bug Dlls unloaded before OnDisable?

Discussion in 'Editor & General Support' started by lmbarns, Jan 22, 2023.

  1. lmbarns

    lmbarns

    Joined:
    Jul 14, 2011
    Posts:
    1,628
    I tried moving shared code between Unity and a server to a shared lib, but it seems to get unloaded before OnDisable gets fired.

    Basically in OnDisable I send a disconnect packet to the server, it works if I use a packet class inside Unity, but when I move that same code to the class library the dll is being unloaded before OnDisable fires and it can't find the packet...all other packets work from the class lib, just not what's being called in OnDisable. The DLL isn't sending anything it's just packet concrete implementations I'm using from 2 projects

    Is that normal behavior? Unity 2021.3.f16 LTS
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,736
    lmbarns likes this.
  3. lmbarns

    lmbarns

    Joined:
    Jul 14, 2011
    Posts:
    1,628
    Didn't know about OnApplicationQuit thanks!
     
    Kurt-Dekker likes this.