{"action":"created","issue":{"url":"https://api.github.com/repos/arrayfire/arrayfire-rust/issues/26","labels_url":"https://api.github.com/repos/arrayfire/arrayfire-rust/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/arrayfire/arrayfire-rust/issues/26/comments","events_url":"https://api.github.com/repos/arrayfire/arrayfire-rust/issues/26/events","html_url":"https://github.com/arrayfire/arrayfire-rust/issues/26","id":103259409,"number":26,"title":"passing a str pointer (or even a String) into af::Window::new via a function call results in a GLFWWindow Error for Graphics module","user":{"login":"jramapuram","id":8204807,"avatar_url":"https://avatars.githubusercontent.com/u/8204807?v=3","gravatar_id":"","url":"https://api.github.com/users/jramapuram","html_url":"https://github.com/jramapuram","followers_url":"https://api.github.com/users/jramapuram/followers","following_url":"https://api.github.com/users/jramapuram/following{/other_user}","gists_url":"https://api.github.com/users/jramapuram/gists{/gist_id}","starred_url":"https://api.github.com/users/jramapuram/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jramapuram/subscriptions","organizations_url":"https://api.github.com/users/jramapuram/orgs","repos_url":"https://api.github.com/users/jramapuram/repos","events_url":"https://api.github.com/users/jramapuram/events{/privacy}","received_events_url":"https://api.github.com/users/jramapuram/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/arrayfire/arrayfire-rust/labels/Bugfix","name":"Bugfix","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"9prady9","id":3270458,"avatar_url":"https://avatars.githubusercontent.com/u/3270458?v=3","gravatar_id":"","url":"https://api.github.com/users/9prady9","html_url":"https://github.com/9prady9","followers_url":"https://api.github.com/users/9prady9/followers","following_url":"https://api.github.com/users/9prady9/following{/other_user}","gists_url":"https://api.github.com/users/9prady9/gists{/gist_id}","starred_url":"https://api.github.com/users/9prady9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/9prady9/subscriptions","organizations_url":"https://api.github.com/users/9prady9/orgs","repos_url":"https://api.github.com/users/9prady9/repos","events_url":"https://api.github.com/users/9prady9/events{/privacy}","received_events_url":"https://api.github.com/users/9prady9/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/arrayfire/arrayfire-rust/milestones/2","html_url":"https://github.com/arrayfire/arrayfire-rust/milestones/3.2","labels_url":"https://api.github.com/repos/arrayfire/arrayfire-rust/milestones/2/labels","id":1287081,"number":2,"title":"3.2","description":"Planning to do a stable release arrayfire-rust wrapper with 3.2 release of ArrayFire.","creator":{"login":"9prady9","id":3270458,"avatar_url":"https://avatars.githubusercontent.com/u/3270458?v=3","gravatar_id":"","url":"https://api.github.com/users/9prady9","html_url":"https://github.com/9prady9","followers_url":"https://api.github.com/users/9prady9/followers","following_url":"https://api.github.com/users/9prady9/following{/other_user}","gists_url":"https://api.github.com/users/9prady9/gists{/gist_id}","starred_url":"https://api.github.com/users/9prady9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/9prady9/subscriptions","organizations_url":"https://api.github.com/users/9prady9/orgs","repos_url":"https://api.github.com/users/9prady9/repos","events_url":"https://api.github.com/users/9prady9/events{/privacy}","received_events_url":"https://api.github.com/users/9prady9/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":5,"state":"open","created_at":"2015-09-02T19:38:04Z","updated_at":"2015-10-01T21:29:58Z","due_on":"2015-11-10T05:00:00Z","closed_at":null},"comments":3,"created_at":"2015-08-26T12:47:40Z","updated_at":"2015-10-01T21:29:58Z","closed_at":null,"body":"```rust\r\npub fn plot(raw_values: Vec<f32>, title: &'static str, window_x: u16, window_y: u16) {\r\n  // copy from float vector to Array\r\n  let dims = Dim4::new(&[raw_values.len() as u64, 1, 1, 1]);\r\n  let values = &Array::new(dims, &raw_values.as_ref(), Aftype::F32).unwrap();\r\n\r\n  // create a window\r\n  let title_str = String::from(title); // if we don't .clone() we get a crash!\r\n  let wnd = match af::Window::new(window_x as i32, window_y as i32, title_str) {\r\n    Ok(v)  => v,\r\n    Err(e) => panic!(\"Window creation failed: {}\", e), //XXX: handle better\r\n  };\r\n\r\n  // display till closed\r\n  loop {\r\n    wnd.draw_plot(&af::range(dims, 0, af::Aftype::F32).unwrap(), &values, None);\r\n    if wnd.is_closed().unwrap() == true { break; }\r\n  }\r\n}\r\n```\r\n\r\nresults in:\r\n\r\n```bash\r\n2015-08-26 14:44:37.785 perceptron[11818:5138515] *** Assertion failure in -[GLFWWindow setTitle:], /SourceCache/AppKit/AppKit-1348.17/AppKit.subproj/NSWindow.m:3068\r\nthread '<main>' panicked at 'Window creation failed: Unkown Error', src/plot.rs:14\r\nAn unknown error occurred\r\n```\r\n\r\n**Possible solution:** run .clone() internally in the appropriate functions"},"comment":{"url":"https://api.github.com/repos/arrayfire/arrayfire-rust/issues/comments/144855721","html_url":"https://github.com/arrayfire/arrayfire-rust/issues/26#issuecomment-144855721","issue_url":"https://api.github.com/repos/arrayfire/arrayfire-rust/issues/26","id":144855721,"user":{"login":"jramapuram","id":8204807,"avatar_url":"https://avatars.githubusercontent.com/u/8204807?v=3","gravatar_id":"","url":"https://api.github.com/users/jramapuram","html_url":"https://github.com/jramapuram","followers_url":"https://api.github.com/users/jramapuram/followers","following_url":"https://api.github.com/users/jramapuram/following{/other_user}","gists_url":"https://api.github.com/users/jramapuram/gists{/gist_id}","starred_url":"https://api.github.com/users/jramapuram/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jramapuram/subscriptions","organizations_url":"https://api.github.com/users/jramapuram/orgs","repos_url":"https://api.github.com/users/jramapuram/repos","events_url":"https://api.github.com/users/jramapuram/events{/privacy}","received_events_url":"https://api.github.com/users/jramapuram/received_events","type":"User","site_admin":false},"created_at":"2015-10-01T21:29:58Z","updated_at":"2015-10-01T21:29:58Z","body":"This is still happening to me:\r\n\r\n```bash\r\n2015-10-01 23:21:20.005 perceptron[36501:331967] *** Assertion failure in -[GLFWWindow setTitle:], /Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1404/AppKit.subproj/NSWindow.m:3166\r\nthread '<main>' panicked at 'Window creation failed: Unkown Error', src/plot.rs:15\r\n[iter: 2047] 0.00087195745 An unknown error occurred\r\n```\r\n\r\nI am using the following version of glfw:\r\n```bash\r\n> brew info homebrew/versions/glfw3\r\nhomebrew/versions/glfw3: stable 3.1.1\r\n```"}}