No title

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Note, we *must not* derive clone and copy for this, so that the borrow
// checker can help us track the life of the DLL.
struct Win32GameCode {
  gameCodeDLL: HMODULE,
  updateAndRender: GameUpdateAndRenderSig,
  getSound: GameGetSoundSamplesSig,
}

impl Drop for Win32GameCode {
  fn drop(&mut self) {
    if !self.gameCodeDLL.is_null() {
      unsafe { FreeLibrary(self.gameCodeDLL) };
    }
  }
}