mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-08 10:51:03 +00:00
Fix crash on Mac, now the strange part
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
This commit is contained in:
parent
cdfed1ce7d
commit
1000b8d218
@ -168,7 +168,8 @@ public:
|
||||
* 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,
|
||||
|
@ -277,8 +277,14 @@ void GuiApplication::registerSocketCallback(int fd, boost::function<void()> func
|
||||
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);
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ public:
|
||||
virtual void updateColor(LColor_color col);
|
||||
virtual void registerSocketCallback(
|
||||
int fd, boost::function<void()> func);
|
||||
virtual void unregisterSocketCallback(int fd);
|
||||
void unregisterSocketCallbackImpl(int fd);
|
||||
//@}
|
||||
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user