@@ -439,7 +439,7 @@ void KsPluginManager::registerFromList(kshark_context *kshark_ctx)
auto lamRegUser = [&kshark_ctx](const QString &plugin)
{
- const char *lib = plugin.toStdString().c_str();
+ const char *lib = plugin.toLocal8Bit().data();
kshark_register_plugin(kshark_ctx, lib);
};
@@ -474,7 +474,7 @@ void KsPluginManager::unregisterFromList(kshark_context *kshark_ctx)
auto lamUregUser = [&kshark_ctx](const QString &plugin)
{
- const char *lib = plugin.toStdString().c_str();
+ const char *lib = plugin.toLocal8Bit().data();
kshark_unregister_plugin(kshark_ctx, lib);
};
const char *lib = plugin.toStdString().c_str(); This line is a bad idea because the returned array may (will) be invalidated when the destructor of std::string is called. Fixes: 18cf94f485("kernel-shark-qt: Add KernalShark Utils") Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com> --- kernel-shark/src/KsUtils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)