Index: remoting/ios/app/host_view_controller.mm |
diff --git a/remoting/ios/app/host_view_controller.mm b/remoting/ios/app/host_view_controller.mm |
index 30b19c417349ef07c04fe3de32afb30e462b3490..e866d7691469a9b691043ca4f52103db509ec5d7 100644 |
--- a/remoting/ios/app/host_view_controller.mm |
+++ b/remoting/ios/app/host_view_controller.mm |
@@ -75,11 +75,16 @@ static const CGFloat kFabInset = 15.f; |
[_client.displayHandler onSurfaceCreated:glView]; |
// viewDidLayoutSubviews may be called before viewDidAppear, in which case |
- // the surface is not ready and onSurfaceChanged will be no-op. |
+ // the surface is not ready to handle the transformation matrix. |
// Call onSurfaceChanged here to cover that case. |
[_client surfaceChanged:self.view.frame]; |
} |
+- (void)viewDidDisappear:(BOOL)animated { |
+ [super viewDidDisappear:animated]; |
+ [(GLKView*)self.view deleteDrawable]; |
+} |
+ |
- (void)viewWillAppear:(BOOL)animated { |
[super viewWillAppear:animated]; |
@@ -96,7 +101,11 @@ static const CGFloat kFabInset = 15.f; |
- (void)viewDidLayoutSubviews { |
[super viewDidLayoutSubviews]; |
- [_client surfaceChanged:self.view.frame]; |
+ if (((GLKView*)self.view).context != nil) { |
+ // If the context is not set yet, the view size will be set in |
+ // viewDidAppear. |
+ [_client surfaceChanged:self.view.bounds]; |
+ } |
CGSize btnSize = _floatingButton.frame.size; |
_floatingButton.frame = |