Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After closing the window, an exception was raised at the return error: 0x000007FFAB9F1FB1D (Qt5Guid. dll) (located in Main.exe): 0xC000000 5: Access conflict occurred while reading position 0xFFFFFFFFFFFF. #1211

Open
qimujun opened this issue Aug 13, 2024 · 0 comments

Comments

@qimujun
Copy link

qimujun commented Aug 13, 2024

This error will be triggered when the window w is closed

`#include
#include
#include "../include/LoadPlugins.h"

#include "ctk/interface/ctkPluginFramework.h"
#include "ctk/interface/ctkPluginFrameworkLauncher.h"
#include "ctk/interface/ctkPluginFrameworkFactory.h"
#include "ctk/interface/ctkPluginException.h"

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

// Initialize CTK Plugin Framework
ctkPluginFrameworkFactory factory;
auto framework = factory.getFramework();
framework->init();
framework->start();

// Load plugins (example: load all plugins from a directory)
ctkPluginContext* context = framework->getPluginContext();
auto plugins = context->getPlugins();

for (const auto& plugin : plugins)
{
	plugin->start();
}

// Create and show the main window
QMainWindow w;
w.show();

// Run the Qt application loop
int result = app.exec();

// Stop plugins and framework after the application loop exits
for (const auto& plugin : plugins)
{
	plugin->stop();
}

framework->stop();
framework->waitForStop(5000); // Wait for up to 5 seconds for the framework to stop

return result;

}`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant