• Jocelyn Turcotte's avatar
    Clear callbacks with an empty value on page destruction · 6fb392ee
    Jocelyn Turcotte authored
    
    The current implementation offers no way to cancel async requests.
    This means that normal applications could easily allow callbacks
    to dereference a destroyed object unless they use a smart pointer
    within the callback function object.
    
    This patch will empty the pending callback list by calling each of
    them with an empty value. This will at least allow applications to
    cover the cases where the page is expected to have a shorter or equal
    lifetime than objects referenced in the callback.
    
    Change-Id: Ia9fc556b03f5d83f904a0ff4b05dc9e440ea488c
    Reviewed-by: default avatarPierre Rossi <pierre.rossi@gmail.com>
    6fb392ee
main.cpp 1.32 KiB
/****************************************************************************
**
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
** $QT_END_LICENSE$
****************************************************************************/
#include <stdio.h>
int main()
   printf("This works\n");
   return 0;