Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Game Development
  4. Using QOpenGLContext in multiple threads, getting "CoreAnimation: warning..."
Forum Updated to NodeBB v4.3 + New Features

Using QOpenGLContext in multiple threads, getting "CoreAnimation: warning..."

Scheduled Pinned Locked Moved Game Development
1 Posts 1 Posters 1.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rem-head
    wrote on 6 Dec 2014, 11:49 last edited by
    #1

    Hello,

    I am getting the following warning when trying to create OpenGL contexts with offscreen surfaces in multiple threads on Mac OS X Yosemite (Qt 5.2.0 clang):

    bq. CoreAnimation: warning, deleted thread with uncommitted CATransaction; created by:
    0 QuartzCore 0x00007fff945510ea _ZN2CA11Transaction4pushEv + 312
    1 QuartzCore 0x00007fff94550f8a _ZN2CA11Transaction15ensure_implicitEv + 276
    2 QuartzCore 0x00007fff94550e24 _ZN2CA11Transaction9set_valueEj12_CAValueTypePKv + 40
    3 QuartzCore 0x00007fff94550db8 +[CATransaction setDisableActions:] + 38
    4 CoreUI 0x00007fff9acce81f -[CUIWindowFrameLayer dealloc] + 96
    5 libobjc.A.dylib 0x00007fff9482f91f _ZN12_GLOBAL__N_119AutoreleasePoolPage3popEPv + 575
    6 CoreFoundation 0x00007fff8cde4272 _CFAutoreleasePoolPop + 50
    7 Foundation 0x00007fff8d1fa413 -[NSAutoreleasePool release] + 146
    8 libqcocoa.dylib 0x0000000104e1c6b1 _ZN12QCocoaWindow14createNSWindowEv + 641
    9 libqcocoa.dylib 0x0000000104e1a330 _ZN12QCocoaWindow14recreateWindowEPK15QPlatformWindow + 384
    10 libqcocoa.dylib 0x0000000104e1a03e _ZN12QCocoaWindowC2EP7QWindow + 622
    11 libqcocoa.dylib 0x0000000104e160f2 _ZNK17QCocoaIntegration20createPlatformWindowEP7QWindow + 34
    12 QtGui 0x0000000100de3113 _ZN7QWindow6createEv + 51
    13 QtCtx 0x000000010000491a _Z13anotherThreadv + 250
    14 QtCtx 0x0000000100005103 _ZN12QtConcurrent18StoredFunctorCall0IvPFvvEE10runFunctorEv + 19
    15 QtCtx 0x0000000100004ff7 _ZN12QtConcurrent15RunFunctionTaskIvE3runEv + 87

    A minimal sample code looks the following:
    @#include <QtCore>
    #include <QtOpenGL>
    #include <QtConcurrent/qtconcurrentrun.h>

    QOpenGLContext* ctxMain;

    void anotherThread()
    {
    // create context
    QOpenGLContext* ctx2 = new QOpenGLContext();
    ctx2->setFormat(ctxMain->format());
    ctx2->setShareContext(ctxMain);
    ctx2->create();

    // create surface
    QOffscreenSurface* surface2 = new QOffscreenSurface();
    surface2->setFormat(ctxMain->format());
    surface2->create();
    
    // TODO do drawing here
    
    // clean up
    ctx2->deleteLater();
    surface2->deleteLater();
    

    }

    int main(int argc, char **argv)
    {
    QApplication app(argc, argv);

    // create OpenGL context
    ctxMain = new QOpenGLContext();
    QSurfaceFormat format;
    ctxMain->setFormat(format);
    ctxMain->create();
    
    // create surface
    QOffscreenSurface* surfaceMain = new QOffscreenSurface();
    surfaceMain->create();
    
    // TODO do drawing here
    
    // run another thread
    QFuture<void> future = QtConcurrent::run(&anotherThread);
    while (!future.isFinished())
        QThread::sleep(10);
    
    // clean up
    ctxMain->deleteLater();
    surfaceMain->deleteLater();
    
    return 0;
    

    }@

    Do you know what causes this message? Is there a way how to fix this?

    1 Reply Last reply
    0

    1/1

    6 Dec 2014, 11:49

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved