Part 2: avoid pure virtual function,
if (theApp)
theApp->unregisterSocketCallback(fd_);
does not help, we've tested it!
Without a Mac it is hard to find a better solution
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16110
a592a061-630c-0410-9148-
cb99ea01b6c8
* remove a I/O read callback
* @param fd socket descriptor (file/socket/etc)
*/
- virtual void unregisterSocketCallback(int fd) = 0;
+ template<class T>
+ void unregisterSocketCallback(T fd);
/// Create the main window with given geometry settings.
LyXView & createView(unsigned int width, unsigned int height,
boost::shared_ptr<socket_callback>(new socket_callback(fd, func));
}
+template<>
+void Application::unregisterSocketCallback<int>(int fd)
+{
+ GuiApplication* ptr = static_cast<GuiApplication*>(this);
+ ptr->unregisterSocketCallbackImpl(fd);
+}
-void GuiApplication::unregisterSocketCallback(int fd)
+void GuiApplication::unregisterSocketCallbackImpl(int fd)
{
socket_callbacks_.erase(fd);
}
virtual void updateColor(LColor_color col);
virtual void registerSocketCallback(
int fd, boost::function<void()> func);
- virtual void unregisterSocketCallback(int fd);
+ void unregisterSocketCallbackImpl(int fd);
//@}
///