Kaydet (Commit) e3ece4b3 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Handle a case where the profile initialization fails.

Change-Id: Ifd1ab147926ab4f1d34161840d17fdf1ab3f9810
üst 1283dcb0
...@@ -428,9 +428,16 @@ ds_device getDeviceSelection(const char* sProfilePath, bool bForceSelection) ...@@ -428,9 +428,16 @@ ds_device getDeviceSelection(const char* sProfilePath, bool bForceSelection)
{ {
/* Setup */ /* Setup */
ds_status status; ds_status status;
ds_profile* profile; ds_profile* profile = NULL;
status = initDSProfile(&profile, "LibreOffice v0.1"); status = initDSProfile(&profile, "LibreOffice v0.1");
if (!profile)
{
// failed to initialize profile.
selectedDevice.oclDeviceID = NULL;
return selectedDevice;
}
/* Try reading scores from file */ /* Try reading scores from file */
std::string tmpStr(sProfilePath); std::string tmpStr(sProfilePath);
const char* fileName = tmpStr.append("sc_opencl_device_profile.dat").c_str(); const char* fileName = tmpStr.append("sc_opencl_device_profile.dat").c_str();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment