Currently, the win32 window callback relies on thread-local storage to stash data for the callback function. This isn't necessary - by using the win32 subclassing API, it is possible to pass a user-defined pointer into the window function with the dwRefData parameter in a subclass. By boxing up the callback data and freeing it when the window is destroyed, the use of the thread_local macro can be avoided.
Currently, the win32 window callback relies on thread-local storage to stash data for the callback function. This isn't necessary - by using the win32 subclassing API, it is possible to pass a user-defined pointer into the window function with the
dwRefDataparameter in a subclass. By boxing up the callback data and freeing it when the window is destroyed, the use of thethread_localmacro can be avoided.