<commit_before>#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include <QImage>
#include <QCommandLineParser>
#include "rawimageprovider.h"

int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);

    // Parse command line options
    QCommandLineParser parser;
    parser.setApplicationDescription(app.translate("main", "Raw G12 image viewer. At the moment only supports 2448x2048 resolution."));
    parser.addHelpOption();
    QCommandLineOption savePgmOption(QStringLiteral("pgm"), app.translate("main", "Save loaded image into PGM."));
    parser.addOption(savePgmOption);
    parser.addPositionalArgument(QStringLiteral("FILE"), app.translate("main", "Path to a raw image file."));

    parser.process(app);
    QStringList args = parser.positionalArguments();
    bool pgm = parser.isSet(savePgmOption);
    if(args.length() != 1) {
        parser.showHelp();
        return 0;
    }

    QQmlApplicationEngine engine;
    RawImageProvider provider;
    provider.loadImage(args[0], pgm);
    engine.addImageProvider("raw", &provider);
    engine.load(QUrl(QStringLiteral("qrc:/main.qml")));

    return app.exec();
}<commit_msg>Don't crash on exit<commit_after>#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include <QImage>
#include <QCommandLineParser>
#include "rawimageprovider.h"

int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);

    // Parse command line options
    QCommandLineParser parser;
    parser.setApplicationDescription(app.translate("main", "Raw G12 image viewer. At the moment only supports 2448x2048 resolution."));
    parser.addHelpOption();
    QCommandLineOption savePgmOption(QStringLiteral("pgm"), app.translate("main", "Save loaded image into PGM."));
    parser.addOption(savePgmOption);
    parser.addPositionalArgument(QStringLiteral("FILE"), app.translate("main", "Path to a raw image file."));

    parser.process(app);
    QStringList args = parser.positionalArguments();
    bool pgm = parser.isSet(savePgmOption);
    if(args.length() != 1) {
        parser.showHelp();
        return 0;
    }

    QQmlApplicationEngine engine;
    RawImageProvider *provider = new RawImageProvider();
    provider->loadImage(args[0], pgm);
    engine.addImageProvider("raw", provider);
    engine.load(QUrl(QStringLiteral("qrc:/main.qml")));

    return app.exec();
}
{'fraction_non_alphanumeric': 0.13164451827242524, 'fraction_numerical': 0.01079734219269103, 'mean_word_length': 4.695035460992908, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3325066', 'n_tokens_mistral': 751, 'n_tokens_neox': 714, 'n_words': 163}