with shared memory
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
//#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include "rktwebview_qt.h"
|
||||
#include "shmqueue.h"
|
||||
|
||||
uint64_t current_ms() {
|
||||
using namespace std::chrono;
|
||||
@@ -17,7 +18,14 @@ uint64_t current_ms() {
|
||||
// Main C Interface
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
Rktwebview_qt *handler = nullptr;
|
||||
typedef struct {
|
||||
Shm *shm;
|
||||
ShmQueue *command_queue;
|
||||
ShmQueue *event_queue;
|
||||
Rktwebview_qt *rkt;
|
||||
} Handle_t;
|
||||
|
||||
Handle_t *handler = nullptr;
|
||||
|
||||
void rkt_webview_cleanup()
|
||||
{
|
||||
@@ -25,6 +33,27 @@ void rkt_webview_cleanup()
|
||||
// Does nothing.
|
||||
// See QTBUG-145033
|
||||
// QtWebEngine cannot be started as part of QApplication more than once in an application run.
|
||||
// So we would need to cleanup at exit of racket/drracket.
|
||||
// Cleaning up when exiting the current custodian is not enough.
|
||||
|
||||
/*
|
||||
QApplication *app = handler->app();
|
||||
if (app != nullptr) {
|
||||
// testing with #:custodian (current-custodian)
|
||||
QTimer t;
|
||||
QObject::connect(&t, &QTimer::timeout, app, [app]() {
|
||||
fprintf(stderr, "Quitting\n");
|
||||
app->quit();
|
||||
});
|
||||
t.setSingleShot(true);
|
||||
t.start(250);
|
||||
fprintf(stderr, "Executing app\n");
|
||||
app->exec();
|
||||
fprintf(stderr, "App exited\n");
|
||||
delete handler;
|
||||
handler = nullptr;
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user