Bugfix: fix crash during frequent screen plugging and unplugging
Defer deleting global object, thus keep client's request vaild for a while.
Merge Request:!5720
Commit:6ff4a9db
Set the dual screen to the left and right expansion, and then quickly plug and unplug the external screen. There is a high probability that the operation of the plug screen will crash during the opening of the application.
The remove operation signals that the global object will be destroyed, and destroy actually removes the global object. The wayland core protocol does not specify how the server should behave after removal, but it does specify that the client should immediately stop using the removed object.
That is, the error case is that bind occurs between global_remove and delete_id, that is, when the server issues global_remove, but the client has not received it, the client sends the bind request, and then bind arrives at the server, this bind has become an illegal request in fact. This causes the server to report an error(invalid global) error, which sends an error event to the client and shuts down the client the next time it sends a request to the server.
Therefore, the client crash problem is due to the direct use of global objects that have already been removed. The Bug phenomenon is that when a large number of applications are started at the same time, a large number of requests for bind server global object will be made. At this time, the fast plug-in screen may cause the preset timeout event to be not long enough, resulting in the client bind request being processed after the server has destroyed the global object.