diff options
author | AKalinich-Luxoft <AKalinich@luxoft.com> | 2017-09-14 13:16:54 +0300 |
---|---|---|
committer | AKalinich-Luxoft <AKalinich@luxoft.com> | 2017-09-18 18:59:31 +0300 |
commit | 8455aab11dd3e1f6e9828be4c6cd3a62cad9870a (patch) | |
tree | f59f106c00a5ff8722f3154d0c071f3b63e9151e /src/components/remote_control/include/remote_control/resource_allocation_manager.h | |
parent | da4b5766ca3f1fca4caa4b4815073f72dfe37182 (diff) | |
download | sdl_core-8455aab11dd3e1f6e9828be4c6cd3a62cad9870a.tar.gz |
Fix SDL crash on exit/unregistering of non-RC application
SDL plugin manager is receiving notifications from application manager
when any application was deactivated or unregistered. This notification
will be transfered from plugin manager to RC plugin. However RC plugin
processes events from any application so when it try to process event
from non-RC application, SDL crashes. RC plugin should process events only
from applications with RC functionality.
Also there is another problem when application is unregistering its app_id()
is removing from applications list in AM before OnApplicationEvent() call
so when some of plugins will try to get shared_ptr using app_id, it will
receive null pointer, however in AM still exists shared_ptr to this app.
So it will be better to pass shared_ptr of application instead of accessing to
it every time from plugins using app_id parameter. Moreover, some of plugins could
require more information about application in future.
Following changes were done:
- Updated OnApplicationEvent() with application shared_ptr param for plugin
manager and all related plugins
- RC plugin now triggers OnApplicationEvent only for events from RC applications
Diffstat (limited to 'src/components/remote_control/include/remote_control/resource_allocation_manager.h')
-rw-r--r-- | src/components/remote_control/include/remote_control/resource_allocation_manager.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/components/remote_control/include/remote_control/resource_allocation_manager.h b/src/components/remote_control/include/remote_control/resource_allocation_manager.h index e9712370d9..f789fe4af9 100644 --- a/src/components/remote_control/include/remote_control/resource_allocation_manager.h +++ b/src/components/remote_control/include/remote_control/resource_allocation_manager.h @@ -78,10 +78,11 @@ class ResourceAllocationManager { /** * @brief OnApplicationEvent Processes application related events * @param event Event - * @param application_id Application id + * @param application Pointer to application struct */ - virtual void OnApplicationEvent(functional_modules::ApplicationEvent event, - const uint32_t application_id) = 0; + virtual void OnApplicationEvent( + functional_modules::ApplicationEvent event, + application_manager::ApplicationSharedPtr application) = 0; /** * @brief OnPolicyEvent Processes policy related events |