Error when unloading plugin that uses winsock2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello. I'm currently creating a plugin that uses winsock2 for a peer to peer tcp-connection. When I try to unload my plugin, Maya crashes and produces the log-file that I have uploaded here. I have concluded that this crash is caused somehow when I include the code that tries to connect a socket to an address and port by using the winsock functions socket() and connect(). I'm very lost of why this is happening only when unloading the plugin, but not during the connect() calls etc. The connect() and socket() and most other winsock calls are made in a function that is called using the MThreadAsync::CreateTask() and later exited correctly.
Also, I know where it is crashing. It is crashing when deleting my connection instance during the uninitialize-function of the plugin. My connection instance contains all the winsock data such as the sockets, addrinfo etc.